Skip to content

Commit b44417c

Browse files
fixup! fixup! fixup! Replace relpath with cheaper function
1 parent 848ee73 commit b44417c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

test/internals.jl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -395,11 +395,13 @@ end
395395
@test nestedrelpath(path, "test/dir/other") == "test/dir/foo_test.jl"
396396
@test nestedrelpath(path, "test/dir/other/bar_test.jl") == "test/dir/foo_test.jl"
397397

398-
@test 1 >= @allocations(nestedrelpath(path, "test"))
399-
@test 1 >= @allocations(nestedrelpath(path, "test/dir"))
400-
@test 0 == @allocations(nestedrelpath(path, "test/dir/foo_test.jl"))
401-
@test 0 == @allocations(nestedrelpath(path, "test/dir/other"))
402-
@test 0 == @allocations(nestedrelpath(path, "test/dir/other/bar_test.jl"))
398+
if isdefined(Base, Symbol("@allocations")) # added in Julia v1.9
399+
@test 1 >= @allocations(nestedrelpath(path, "test"))
400+
@test 1 >= @allocations(nestedrelpath(path, "test/dir"))
401+
@test 0 == @allocations(nestedrelpath(path, "test/dir/foo_test.jl"))
402+
@test 0 == @allocations(nestedrelpath(path, "test/dir/other"))
403+
@test 0 == @allocations(nestedrelpath(path, "test/dir/other/bar_test.jl"))
404+
end
403405
end
404406

405407
end # internals.jl testset

0 commit comments

Comments
 (0)