summaryrefslogtreecommitdiff
path: root/test/json
diff options
context:
space:
mode:
Diffstat (limited to 'test/json')
-rw-r--r--test/json/json_addition_test.rb2
-rw-r--r--test/json/json_parser_test.rb5
2 files changed, 6 insertions, 1 deletions
diff --git a/test/json/json_addition_test.rb b/test/json/json_addition_test.rb
index e95ace8375..614c735567 100644
--- a/test/json/json_addition_test.rb
+++ b/test/json/json_addition_test.rb
@@ -165,7 +165,7 @@ class JSONAdditionTest < Test::Unit::TestCase
def test_utc_datetime
now = Time.now
- d = DateTime.parse(now.to_s, :create_additions => true) # usual case
+ d = DateTime.parse(now.to_s) # usual case
assert_equal d, parse(d.to_json, :create_additions => true)
d = DateTime.parse(now.utc.to_s) # of = 0
assert_equal d, parse(d.to_json, :create_additions => true)
diff --git a/test/json/json_parser_test.rb b/test/json/json_parser_test.rb
index dce693e548..146ff7c047 100644
--- a/test/json/json_parser_test.rb
+++ b/test/json/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" => {} }]