aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-16 03:04:46 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-16 03:04:46 +0000
commit920d9f7c7feb802be72bd5b1a072fa74f21c4b4f (patch)
tree8223ba29cbf417210e2686b72edd9045d6324b4e /test
parent2b842ff8bac8682812e614d0f8fe48d5a3cca460 (diff)
downloadruby-920d9f7c7feb802be72bd5b1a072fa74f21c4b4f.tar.gz
Merge json-2.1.0 from https://github.com/flori/json
https://github.com/flori/json/blob/master/CHANGES.md#2017-04-18-210 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/json/json_parser_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/json/json_parser_test.rb b/test/json/json_parser_test.rb
index 40ad500cb6..f36e9c84e1 100644
--- a/test/json/json_parser_test.rb
+++ b/test/json/json_parser_test.rb
@@ -108,6 +108,11 @@ class JSONParserTest < Test::Unit::TestCase
assert_equal -1.0/0, parse('-Infinity', :allow_nan => true)
end
+ def test_parse_bigdecimals
+ assert_equal(BigDecimal, JSON.parse('{"foo": 9.01234567890123456789}', decimal_class: BigDecimal)["foo"].class)
+ assert_equal(BigDecimal.new("0.901234567890123456789E1"),JSON.parse('{"foo": 9.01234567890123456789}', decimal_class: BigDecimal)["foo"] )
+ end
+
if Array.method_defined?(:permutation)
def test_parse_more_complex_arrays
a = [ nil, false, true, "foßbar", [ "n€st€d", true ], { "nested" => true, "n€ßt€ð2" => {} }]