Skip to content

Commit 92df2f4

Browse files
authored
Only test error string on 1.9+
1 parent a1ba7e7 commit 92df2f4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/unittests.jl

+6-1
Original file line numberDiff line numberDiff line change
@@ -1860,7 +1860,12 @@ all_map_count_before_registering = length(ALL_MAPPING)
18601860
@register_unit MySV us"V"
18611861
@register_unit MySV2 us"km/h"
18621862

1863-
@test_throws "Unit `m` is already defined as `1.0 m`" esc(_register_unit(:m, u"s"))
1863+
if VERSION >= v"1.9"
1864+
@test_throws "Unit `m` is already defined as `1.0 m`" esc(_register_unit(:m, u"s"))
1865+
1866+
# Constants as well:
1867+
@test_throws "Unit `Ryd` is already defined" esc(_register_unit(:Ryd, u"Constants.Ryd"))
1868+
end
18641869

18651870
@testset "Register Unit" begin
18661871
@test MyV === u"V"

0 commit comments

Comments
 (0)