From 8325940a451ba7438597ae3a0ae7d86ddd0e95b9 Mon Sep 17 00:00:00 2001 From: Lyndon White Date: Mon, 19 Oct 2020 14:44:27 +0100 Subject: [PATCH 1/2] stringify orig_expr in meta-metatests --- test/meta_testing_tools.jl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/meta_testing_tools.jl b/test/meta_testing_tools.jl index 0bc5055b..4256047e 100644 --- a/test/meta_testing_tools.jl +++ b/test/meta_testing_tools.jl @@ -107,8 +107,13 @@ end end end @test length(fails) === 2 - @test fails[1].orig_expr == :(false==true) - @test fails[2].orig_expr == :(true==false) + + + # Newer versions of Julia return a `String`, not an `Expr`. + # Always calling `string` on it gives gives consistency regardless of version. + # https://github.com/JuliaLang/julia/pull/37809 + @test string(fails[1].orig_expr) == "false == true" + @test string(fails[2].orig_expr) == "true == false" end end From 88cb0ce128a7da617e295d372f4c3263c7ee2a72 Mon Sep 17 00:00:00 2001 From: Lyndon White Date: Tue, 15 Dec 2020 18:25:58 +0000 Subject: [PATCH 2/2] string RHS also so any spacing etc doesn't break it, and also do the single false --- test/meta_testing_tools.jl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/meta_testing_tools.jl b/test/meta_testing_tools.jl index 4256047e..d50e2f12 100644 --- a/test/meta_testing_tools.jl +++ b/test/meta_testing_tools.jl @@ -96,7 +96,10 @@ end @testset "Single Test" begin fails = nonpassing_results(()->@test false) @test length(fails) === 1 - @test fails[1].orig_expr == false + # Julia 1.6 return a `String`, not an `Expr`. + # Always calling `string` on it gives gives consistency regardless of version. + # https://github.com/JuliaLang/julia/pull/37809 + @test string(fails[1].orig_expr) == string(false) end @testset "Single Testset" begin @@ -107,13 +110,12 @@ end end end @test length(fails) === 2 - - # Newer versions of Julia return a `String`, not an `Expr`. + # Julia 1.6 return a `String`, not an `Expr`. # Always calling `string` on it gives gives consistency regardless of version. # https://github.com/JuliaLang/julia/pull/37809 - @test string(fails[1].orig_expr) == "false == true" - @test string(fails[2].orig_expr) == "true == false" + @test string(fails[1].orig_expr) == string(:(false == true)) + @test string(fails[2].orig_expr) == string(:(true == false)) end end