Skip to content

Commit 7f5d298

Browse files
author
Ben Baumgold
committed
fix tests
1 parent 5bf83fc commit 7f5d298

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

test/runtests.jl

+9-6
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ end
2020
@test showtable(nttable) isa WebIO.Scope
2121
end
2222
@testset "inf, nan, and missing serializing" begin
23-
rows = Tables.table([NaN Inf -Inf 0 missing])
2423
names = [:a, :b, :c, :d, :e]
24+
rows = Tables.table([NaN Inf -Inf 0 missing]; header=names)
2525
types = vcat([Float64 for _ in 1:4], [Missing])
2626
Base.show(io::IO, x::Missing) = print(io, "test_missing")
27-
json = TableView.table2json(Tables.Schema(names, types), rows, types)
27+
schema = Tables.Schema(names, types)
28+
json = TableView.table2json(schema, Tables.rows(rows), types)
2829
firstrow = JSON.parse(json)[1]
2930
@test firstrow["a"] == "NaN"
3031
@test firstrow["b"] == "Inf"
@@ -33,20 +34,22 @@ end
3334
@test firstrow["e"] == "test_missing"
3435
end
3536
@testset "large integers" begin
36-
rows = Tables.table([2^52 2^53 2^54])
3737
names = [:a, :b, :c]
38+
rows = Tables.table([2^52 2^53 2^54]; header=names)
3839
types = [Int64 for _ in 1:3]
39-
json = TableView.table2json(Tables.Schema(names, types), rows, types)
40+
schema = Tables.Schema(names, types)
41+
json = TableView.table2json(schema, Tables.rows(rows), types)
4042
firstrow = JSON.parse(json)[1]
4143
@test firstrow["a"] == 4503599627370496
4244
@test firstrow["b"] == "9007199254740992"
4345
@test firstrow["c"] == "18014398509481984"
4446
end
4547
@testset "large floats" begin
46-
rows = Tables.table([1.0e50 1.0e100])
4748
names = [:a, :b]
49+
rows = Tables.table([1.0e50 1.0e100]; header=names)
4850
types = [Float64, Float64]
49-
json = TableView.table2json(Tables.Schema(names, types), rows, types)
51+
schema = Tables.Schema(names, types)
52+
json = TableView.table2json(schema, Tables.rows(rows), types)
5053
firstrow = JSON.parse(json)[1]
5154
@test firstrow["a"] == "1.0e50"
5255
@test firstrow["b"] == "1.0e100"

0 commit comments

Comments
 (0)