Skip to content

Commit ecc70ed

Browse files
committed
add test from issue 19
1 parent 1ca251e commit ecc70ed

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Mjolnir"
22
uuid = "1154507a-7ac2-44fe-9f15-34617bca9db5"
33
authors = ["Mike J Innes <[email protected]>"]
4-
version = "0.2.0"
4+
version = "0.2.1"
55

66
[deps]
77
IRTools = "7869d1d1-7146-5819-86e3-90919afe41df"

test/trace.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,15 @@ tr = @trace f(::Matrix{Int32})
164164
f(xs) = sum(xs, dims = 1)
165165
tr = @trace f(::Matrix{Int32})
166166
@test returntype(tr) == Matrix{Int32}
167+
168+
169+
function negsquare(x)
170+
if x > 0
171+
return x^2
172+
else
173+
return -x^2
174+
end
175+
end
176+
177+
tr = @trace negsquare(::Float64)
178+
@test returntype(tr) == Float64

0 commit comments

Comments
 (0)