Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests on Julia 1.2 and Julia nightly #36

Merged
merged 1 commit into from
Sep 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ my_stable_add_undecorated(y) = my_add(y)
@test warns_for(ws, "returns")

ws = Traceur.warnings(() -> naive_sum([1]))
@test isempty(ws)
if Base.VERSION >= v"1.2.0"
@test length(ws) == 4
@test warns_for(ws, "assigned")
else
@test isempty(ws)
end

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

ws = Traceur.warnings(() -> naive_sum_wrapper(rand(3)); maxdepth = 1)
@test length(ws) == 4
if Base.VERSION >= v"1.2.0"
@test length(ws) == 6
else
@test length(ws) == 4
end
@test warns_for(ws, "assigned", "returns")
end

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

ws = Traceur.warnings(() -> Foo.naive_sum_wrapper(rand(3)); maxdepth = 2, modules=[Foo.Bar])
@test length(ws) == 3
if Base.VERSION >= v"1.2.0"
@test length(ws) == 5
else
@test length(ws) == 3
end
@test warns_for(ws, "assigned", "returns")

ws = Traceur.warnings(() -> Foo.naive_sum_wrapper(rand(3)); maxdepth = 2, modules=[Foo, Foo.Bar])
@test length(ws) == 4
if Base.VERSION >= v"1.2.0"
@test length(ws) == 6
else
@test length(ws) == 4
end
@test warns_for(ws, "assigned", "returns")
end

Expand Down