Skip to content

Commit

Permalink
Update runtests.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
DilumAluthge committed Jun 8, 2021
1 parent 4c10bcb commit ca714aa
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion test/runtests.jl
@@ -1,11 +1,25 @@
using CoverageTools
using Test

if VERSION < v"1.1-"
if Base.VERSION < v"1.1"
isnothing(x) = false
isnothing(x::Nothing) = true
end

if Base.VERSION < v"1.4"
function only(x::Array)
i = iterate(x)
@boundscheck if i === nothing
throw(ArgumentError("Collection is empty, must contain exactly 1 element"))
end
(ret, state) = i::NTuple{2,Any}
@boundscheck if iterate(x, state) !== nothing
throw(ArgumentError("Collection has multiple elements, must contain exactly 1 element"))
end
return ret
end
end

withenv("DISABLE_AMEND_COVERAGE_FROM_SRC" => nothing) do

@testset "iscovfile" begin
Expand Down

0 comments on commit ca714aa

Please sign in to comment.