Skip to content

Commit c48305b

Browse files
authored
Merge pull request #36 from DilumAluthge/da/fixtests
Fix tests on Julia 1.2 and Julia nightly
2 parents ab7b936 + 0235f7d commit c48305b

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

test/runtests.jl

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,12 @@ my_stable_add_undecorated(y) = my_add(y)
5858
@test warns_for(ws, "returns")
5959

6060
ws = Traceur.warnings(() -> naive_sum([1]))
61-
@test isempty(ws)
61+
if Base.VERSION >= v"1.2.0"
62+
@test length(ws) == 4
63+
@test warns_for(ws, "assigned")
64+
else
65+
@test isempty(ws)
66+
end
6267

6368
ws = Traceur.warnings(() -> naive_sum([1.0]))
6469
@test warns_for(ws, "assigned", "returns")
@@ -78,7 +83,11 @@ my_stable_add_undecorated(y) = my_add(y)
7883
@test warns_for(ws, "returns")
7984

8085
ws = Traceur.warnings(() -> naive_sum_wrapper(rand(3)); maxdepth = 1)
81-
@test length(ws) == 4
86+
if Base.VERSION >= v"1.2.0"
87+
@test length(ws) == 6
88+
else
89+
@test length(ws) == 4
90+
end
8291
@test warns_for(ws, "assigned", "returns")
8392
end
8493

@@ -88,11 +97,19 @@ my_stable_add_undecorated(y) = my_add(y)
8897
@test warns_for(ws, "returns")
8998

9099
ws = Traceur.warnings(() -> Foo.naive_sum_wrapper(rand(3)); maxdepth = 2, modules=[Foo.Bar])
91-
@test length(ws) == 3
100+
if Base.VERSION >= v"1.2.0"
101+
@test length(ws) == 5
102+
else
103+
@test length(ws) == 3
104+
end
92105
@test warns_for(ws, "assigned", "returns")
93106

94107
ws = Traceur.warnings(() -> Foo.naive_sum_wrapper(rand(3)); maxdepth = 2, modules=[Foo, Foo.Bar])
95-
@test length(ws) == 4
108+
if Base.VERSION >= v"1.2.0"
109+
@test length(ws) == 6
110+
else
111+
@test length(ws) == 4
112+
end
96113
@test warns_for(ws, "assigned", "returns")
97114
end
98115

0 commit comments

Comments
 (0)