Skip to content

Commit

Permalink
unbreak testall1 (interaction between core and numbers test)
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash committed Nov 14, 2017
1 parent 25ce673 commit 7e421c1
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions test/numbers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3060,14 +3060,22 @@ end
end
end

@testset "printing non finite floats" for T in subtypes(AbstractFloat)
for (x, sx) in [(T(NaN), "NaN"),
(-T(NaN), "NaN"),
(T(Inf), "Inf"),
(-T(Inf), "-Inf")]
@assert x isa T
@test string(x) == sx
@test sprint(io -> show(IOContext(io, :compact => true), x)) == sx
@test sprint(print, x) == sx
@testset "printing non finite floats" begin
let float_types = Set()
allsubtypes!(Base, AbstractFloat, float_types)
allsubtypes!(Core, AbstractFloat, float_types)
@test !isempty(float_types)

for T in float_types
for (x, sx) in [(T(NaN), "NaN"),
(-T(NaN), "NaN"),
(T(Inf), "Inf"),
(-T(Inf), "-Inf")]
@assert x isa T
@test string(x) == sx
@test sprint(io -> show(IOContext(io, :compact => true), x)) == sx
@test sprint(print, x) == sx
end
end
end
end

0 comments on commit 7e421c1

Please sign in to comment.