Skip to content

Commit cede1a3

Browse files
omusstevengj
authored andcommitted
Don't assume tests are running in Main (#364)
* Modify tests to work when running within a Module * Revise a test
1 parent 2436d35 commit cede1a3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/runtests.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1567,7 +1567,7 @@ A = view(rand(5,5), 1:3, 1:3)
15671567
# julia#17623
15681568
if VERSION >= v"0.5.0-dev+5509"
15691569
# Use include_string to work around unsupported syntax on Julia 0.4
1570-
include_string(Main, """
1570+
include_string(@__MODULE__, """
15711571
@test [true, false] .& [true, true] == [true, false]
15721572
@test [true, false] .| [true, true] == [true, true]
15731573
""")
@@ -1852,7 +1852,11 @@ if VERSION >= v"0.5.0-rc1+46"
18521852
@test b == [1,2,3]
18531853
end
18541854

1855-
@test (@__MODULE__) === Main
1855+
# PR 22064
1856+
module Test22064
1857+
using Base.Test, Compat
1858+
@test (@__MODULE__) === Test22064
1859+
end
18561860

18571861
# invokelatest
18581862
issue19774(x) = 1

0 commit comments

Comments
 (0)