From 1c16c90fbfdd27e0743c26fd8ceb4d82a54562e3 Mon Sep 17 00:00:00 2001 From: Jan Weidner Date: Thu, 1 Aug 2024 09:01:14 +0200 Subject: [PATCH] fix tests --- Project.toml | 4 ++-- test/runtests.jl | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Project.toml b/Project.toml index b58bfd4..4b39b5f 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "StructHelpers" uuid = "4093c41a-2008-41fd-82b8-e3f9d02b504f" authors = ["Jan Weidner and contributors"] -version = "1.3" +version = "1.3.0" [deps] ConstructionBase = "187b0558-2788-49d3-abe0-74a17ed4e7c9" @@ -11,8 +11,8 @@ ConstructionBase = "1.3" julia = "1.6" [extras] -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" StructTypes = "856f2bd8-1eba-4b0a-8007-ebc267875bd4" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] test = ["Test", "StructTypes"] diff --git a/test/runtests.jl b/test/runtests.jl index 5bf8c1d..9165ef6 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -93,9 +93,15 @@ struct SNoIsEqual; a; end @test Empty1() != Empty2() @test hash(Empty1()) != hash(Empty2()) - @test_throws "Bad keyword argument value:" @macroexpand @batteries SErrors kwconstructor="true" - @test_throws "Unsupported keyword" @macroexpand @batteries SErrors kwconstructor=true nonsense=true - @test_throws "Expected a keyword argument of the form name = value" @macroexpand @batteries SErrors nonsense + if VERSION >= v"1.8" + @test_throws "Bad keyword argument value:" @macroexpand @batteries SErrors kwconstructor="true" + @test_throws "Unsupported keyword" @macroexpand @batteries SErrors kwconstructor=true nonsense=true + @test_throws "Expected a keyword argument of the form name = value" @macroexpand @batteries SErrors nonsense + else + @test_throws Exception @macroexpand @batteries SErrors kwconstructor="true" + @test_throws Exception @macroexpand @batteries SErrors kwconstructor=true nonsense=true + @test_throws Exception @macroexpand @batteries SErrors nonsense + end @testset "typesalt" begin