diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-12-01 15:51:26 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-12-01 16:47:06 +0900 |
commit | 86045fca24be94db7a9cbf7a9126e43c212dcc55 (patch) | |
tree | 9d75e4900a44ea6eedd592a7492ff1098e10d97b /test/json/json_generator_test.rb | |
parent | 0dfeb172968cdaefca2ab828c94d3e5f44d91f8f (diff) |
Manually merged from flori/json
> https://github.com/flori/json/pull/525
> Rename escape_slash in script_safe and also escape E+2028 and E+2029
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
> https://github.com/flori/json/pull/454
> Remove unnecessary initialization of create_id in JSON.parse()
Co-authored-by: Watson <watson1978@gmail.com>
Diffstat (limited to 'test/json/json_generator_test.rb')
-rwxr-xr-x | test/json/json_generator_test.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/json/json_generator_test.rb b/test/json/json_generator_test.rb index 1bf4912ec7..46cbf9c7f7 100755 --- a/test/json/json_generator_test.rb +++ b/test/json/json_generator_test.rb @@ -150,6 +150,7 @@ EOT :buffer_initial_length => 1024, :depth => 0, :script_safe => false, + :strict => false, :indent => " ", :max_nesting => 100, :object_nl => "\n", @@ -167,6 +168,7 @@ EOT :buffer_initial_length => 1024, :depth => 0, :script_safe => false, + :strict => false, :indent => "", :max_nesting => 100, :object_nl => "", @@ -184,6 +186,7 @@ EOT :buffer_initial_length => 1024, :depth => 0, :script_safe => false, + :strict => false, :indent => "", :max_nesting => 0, :object_nl => "", @@ -336,7 +339,13 @@ EOT def test_json_generate assert_raise JSON::GeneratorError do - assert_equal true, generate(["\xea"]) + generate(["\xea"]) + end + end + + def test_json_generate_unsupported_types + assert_raise JSON::GeneratorError do + generate(Object.new, strict: true) end end |