diff options
Diffstat (limited to 'tests/json_parser_test.rb')
-rw-r--r-- | tests/json_parser_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/json_parser_test.rb b/tests/json_parser_test.rb index dce693e..146ff7c 100644 --- a/tests/json_parser_test.rb +++ b/tests/json_parser_test.rb @@ -84,6 +84,7 @@ class JSONParserTest < Test::Unit::TestCase assert_equal({ "a" => 23 }, parse(' { "a" : 23 } ')) assert_equal({ "a" => 0.23 }, parse(' { "a" : 0.23 } ')) assert_equal({ "a" => 0.23 }, parse(' { "a" : 0.23 } ')) + assert_equal({ "" => 123 }, parse('{"":123}')) end def test_parse_numbers @@ -114,6 +115,10 @@ class JSONParserTest < Test::Unit::TestCase assert_equal(BigDecimal("0.901234567890123456789E1"),JSON.parse('{"foo": 9.01234567890123456789}', decimal_class: BigDecimal)["foo"] ) end + def test_parse_string_mixed_unicode + assert_equal(["éé"], JSON.parse("[\"\\u00e9é\"]")) + 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" => {} }] |