Skip to content

Commit 28ca05a

Browse files
committed
Fix test
1 parent 4944a41 commit 28ca05a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/runtests.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,14 @@ end
142142
sf()
143143
end
144144

145+
const sval_unassigned = ScopedValue{Int}()
145146
@testset "get with default" begin
146-
const sval_unassigned = ScopedValue{Int}()
147147
@test ScopedValues.get(sval_unassigned, nothing) == nothing
148148
@test ScopedValues.get(sval_unassigned, -1) == -1
149149
@with sval_unassigned=>10 begin
150150
@test ScopedValues.get(sval_unassigned, -1) == 10
151151
end
152+
@static if VERSION >= v"1.9"
152153
@test 0 == @allocations ScopedValues.get(sval_unassigned, nothing)
154+
end
153155
end

0 commit comments

Comments
 (0)