Skip to content

Commit

Permalink
Work around 0.7 deprecations in the tests
Browse files Browse the repository at this point in the history
This requires a test dependency on Compat as well as version
conditionals.
  • Loading branch information
ararslan committed Dec 31, 2017
1 parent 870c525 commit 6cffea3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
1 change: 1 addition & 0 deletions test/REQUIRE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Compat 0.41.0
23 changes: 19 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Base.Test
using Compat
using Compat.Test

module X1
using Reexport
Expand All @@ -17,7 +18,12 @@ module Y2
end
module X2
using Reexport
@reexport using Y2
@static if VERSION >= v"0.7.0-"
# Locally defined modules require a dot prefix in 0.7
@reexport using .Y2
else
@reexport using Y2
end
end
@test union!(Set(), names(X2)) == union!(Set(), [:X2, :Y2, :Z2])
@test X2.Z2 == 2
Expand All @@ -40,7 +46,12 @@ end

module X4
using Reexport
@reexport importall Y2
@static if VERSION >= v"0.7.0-"
# importall is deprecated in 0.7
@reexport using .Y2
else
@reexport importall Y2
end
end
@test union!(Set(), names(X4)) == union!(Set(), [:X4, :Y2, :Z2])
@test X4.Z2 == 2
Expand All @@ -55,7 +66,11 @@ module X5
const Z4 = 4
export Z4
end
@reexport importall .Y3, .Y4
@static if VERSION >= v"0.7.0-"
@reexport using .Y3, .Y4
else
@reexport importall .Y3, .Y4
end
end
@test union!(Set(), names(X3)) == union!(Set(), [:X3, :Y3, :Y4, :Z3, :Z4])
@test X3.Z3 == 3
Expand Down

0 comments on commit 6cffea3

Please sign in to comment.