|
19 | 19 | ]
|
20 | 20 | @test showtable(nttable) isa WebIO.Scope
|
21 | 21 | end
|
22 |
| -@testset "inf and nan serializing" begin |
23 |
| - fields = Array{Union{Missing, Nothing, Float64}}(NaN Inf -Inf 0 missing nothing) |
24 |
| - rows = Tables.table(fields) |
25 |
| - names = [:a, :b, :c, :d, :e, :f] |
26 |
| - types = vcat([Float64 for _ in 1:4], [Missing, Nothing]) |
| 22 | +@testset "inf, nan, and missing serializing" begin |
| 23 | + rows = Tables.table([NaN Inf -Inf 0 missing]) |
| 24 | + names = [:a, :b, :c, :d, :e] |
| 25 | + types = vcat([Float64 for _ in 1:4], [Missing]) |
27 | 26 | Base.show(io::IO, x::Missing) = print(io, "test_missing")
|
28 |
| - Base.show(io::IO, x::Nothing) = print(io, "test_nothing") |
29 | 27 | json = TableView.table2json(Tables.Schema(names, types), rows, types)
|
30 | 28 | firstrow = JSON.parse(json)[1]
|
31 | 29 | @test firstrow["a"] == "NaN"
|
32 | 30 | @test firstrow["b"] == "Inf"
|
33 | 31 | @test firstrow["c"] == "-Inf"
|
34 | 32 | @test firstrow["d"] == 0
|
35 | 33 | @test firstrow["e"] == "test_missing"
|
36 |
| - @test firstrow["f"] == "test_nothing" |
37 | 34 | end
|
38 | 35 | @testset "normal array" begin
|
39 | 36 | array = rand(10, 10)
|
|
0 commit comments