Skip to content

Commit b566c50

Browse files
committed
support only julia >1.10
1 parent db3e7f1 commit b566c50

File tree

1 file changed

+8
-19
lines changed

1 file changed

+8
-19
lines changed

test/runtests.jl

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -263,14 +263,9 @@ end
263263

264264
# issues #43
265265
@testset "macro error" begin
266-
if VERSION < v"1.3"
267-
@test_throws LoadError @macroexpand(IrrationalConstants.@irrational Myπ big(π) Myπ)
268-
@test_throws LoadError @macroexpand(IrrationalConstants.@irrational Myπ 1.0 big(π) Myπ)
269-
else
270-
msg = "The name of the irrational constant (Myπ) and its type (Myπ) cannot be the same. Please choose a different name for the constant or specify a different type name as the last argument to the macro."
271-
@test_throws ArgumentError(msg) @macroexpand(IrrationalConstants.@irrational Myπ big(π) Myπ)
272-
@test_throws ArgumentError(msg) @macroexpand(IrrationalConstants.@irrational Myπ 1.0 big(π) Myπ)
273-
end
266+
msg = "The name of the irrational constant (Myπ) and its type (Myπ) cannot be the same. Please choose a different name for the constant or specify a different type name as the last argument to the macro."
267+
@test_throws ArgumentError(msg) @macroexpand(IrrationalConstants.@irrational Myπ big(π) Myπ)
268+
@test_throws ArgumentError(msg) @macroexpand(IrrationalConstants.@irrational Myπ 1.0 big(π) Myπ)
274269
end
275270

276271
# test that defining a type that already exists throws an error
@@ -280,16 +275,10 @@ module TestTypeCollision
280275
struct MyExistingType end
281276

282277
@testset "type collision" begin
283-
if VERSION < v"1.3"
284-
@test_throws LoadError @macroexpand(IrrationalConstants.@irrational myExistingType big(π))
285-
@test_throws LoadError @macroexpand(IrrationalConstants.@irrational myconst big(π) MyExistingType)
286-
@test_throws LoadError @macroexpand(IrrationalConstants.@irrational myconst 1.0 big(π) MyExistingType)
287-
else
288-
msg1 = "Type `MyExistingType` of irrational constant `myExistingType` is already defined in module `Main.TestTypeCollision`."
289-
@test_throws ArgumentError(msg1) @macroexpand(IrrationalConstants.@irrational myExistingType big(π))
290-
msg2 = "Type `MyExistingType` of irrational constant `myconst` is already defined in module `Main.TestTypeCollision`."
291-
@test_throws ArgumentError(msg2) @macroexpand(IrrationalConstants.@irrational myconst big(π) MyExistingType)
292-
@test_throws ArgumentError(msg2) @macroexpand(IrrationalConstants.@irrational myconst 1.0 big(π) MyExistingType)
293-
end
278+
msg1 = "Type `MyExistingType` of irrational constant `myExistingType` is already defined in module `Main.TestTypeCollision`."
279+
@test_throws ArgumentError(msg1) @macroexpand(IrrationalConstants.@irrational myExistingType big(π))
280+
msg2 = "Type `MyExistingType` of irrational constant `myconst` is already defined in module `Main.TestTypeCollision`."
281+
@test_throws ArgumentError(msg2) @macroexpand(IrrationalConstants.@irrational myconst big(π) MyExistingType)
282+
@test_throws ArgumentError(msg2) @macroexpand(IrrationalConstants.@irrational myconst 1.0 big(π) MyExistingType)
294283
end
295284
end

0 commit comments

Comments
 (0)