mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
bc917f98c0
commit
b304078ae6
6 changed files with 120 additions and 80 deletions
|
@ -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" => {} }]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue