summaryrefslogtreecommitdiff
path: root/tests/test_json.rb
diff options
context:
space:
mode:
authorFlorian Frank <flori@ping.de>2010-04-25 15:43:47 +0200
committerFlorian Frank <flori@ping.de>2010-04-25 15:43:47 +0200
commitd34d8a2195b480abae68ea427be60767793b6196 (patch)
tree26b4fb066740b31d0b05a2b65a404e4797957784 /tests/test_json.rb
parent590ac112a95dd5ce30e52fcf4db17df3a1ed6721 (diff)
downloadjson-d34d8a2195b480abae68ea427be60767793b6196.tar.gz
Fixed T_FIXNUM bug on 64bit architectures.v1.4.1
Diffstat (limited to 'tests/test_json.rb')
-rwxr-xr-xtests/test_json.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_json.rb b/tests/test_json.rb
index 3d26ddb..f5a432f 100755
--- a/tests/test_json.rb
+++ b/tests/test_json.rb
@@ -324,4 +324,17 @@ EOT
JSON.dump(eval(too_deep), output, 20)
assert_equal too_deep, output.string
end
+
+ def test_big_integers
+ json1 = JSON([orig = (1 << 31) - 1])
+ assert_equal orig, JSON[json1][0]
+ json2 = JSON([orig = 1 << 31])
+ assert_equal orig, JSON[json2][0]
+ json3 = JSON([orig = (1 << 62) - 1])
+ assert_equal orig, JSON[json3][0]
+ json4 = JSON([orig = 1 << 62])
+ assert_equal orig, JSON[json4][0]
+ json5 = JSON([orig = 1 << 64])
+ assert_equal orig, JSON[json5][0]
+ end
end