From aa60fb09387f31c6541b4652e813c6e5add0da72 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Wed, 11 Nov 2020 00:33:25 -0500 Subject: [PATCH] tests: fixes for Julia v1.5 --- test/runtests.jl | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 1556dd3..0f2bb40 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -117,13 +117,21 @@ end run(`$(Base.julia_cmd()) --startup-file=no --code-coverage=user -e $cmdstr`) r = process_file(srcname, datadir) - target = Coverage.CovCount[nothing, 2, nothing, 0, nothing, 0, nothing, nothing, nothing, nothing, 0, nothing, nothing, nothing, nothing, nothing, 0, nothing, nothing, 0, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing] + if VERSION < v"1.5" + target = Coverage.CovCount[nothing, 2, nothing, 0, nothing, 0, nothing, nothing, nothing, nothing, 0, nothing, nothing, nothing, nothing, nothing, 0, nothing, nothing, 0, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing] + else + target = Coverage.CovCount[nothing, 1, nothing, 0, nothing, 0, nothing, nothing, nothing, nothing, 0, nothing, nothing, nothing, nothing, 0, 0, nothing, nothing, 0, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing] + end target_disabled = map(x -> (x !== nothing && x > 0) ? x : nothing, target) @test r.coverage == target - covtarget = (sum(x->x !== nothing && x > 0, target), sum(x->x !== nothing, target)) + covtarget = (sum(x -> x !== nothing && x > 0, target), sum(!isnothing, target)) @test get_summary(r) == covtarget - @test get_summary(process_folder(datadir)) == (98, 106) + if VERSION < v"1.5" + @test get_summary(process_folder(datadir)) == (98, 106) + else + @test get_summary(process_folder(datadir)) == (98, 107) + end r_disabled = withenv("DISABLE_AMEND_COVERAGE_FROM_SRC" => "yes") do process_file(srcname, datadir)