Skip to content

Commit 946bb8d

Browse files
author
Ben Baumgold
committed
add unit-test for large integers
1 parent ba4834d commit 946bb8d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/runtests.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ end
3232
@test firstrow["d"] == 0
3333
@test firstrow["e"] == "test_missing"
3434
end
35+
@testset "large integers" begin
36+
rows = Tables.table([2^52 2^53 2^54])
37+
names = [:a, :b, :c]
38+
types = [Int64 for _ in 1:3]
39+
json = TableView.table2json(Tables.Schema(names, types), rows, types)
40+
firstrow = JSON.parse(json)[1]
41+
@test firstrow["a"] == 4503599627370496
42+
@test firstrow["b"] == "9007199254740992"
43+
@test firstrow["c"] == "18014398509481984"
44+
end
3545
@testset "normal array" begin
3646
array = rand(10, 10)
3747
@test showtable(array) isa WebIO.Scope

0 commit comments

Comments
 (0)