summaryrefslogtreecommitdiff
path: root/test/json
diff options
context:
space:
mode:
Diffstat (limited to 'test/json')
-rwxr-xr-x[-rw-r--r--]test/json/json_generator_test.rb7
-rw-r--r--test/json/json_parser_test.rb4
2 files changed, 11 insertions, 0 deletions
diff --git a/test/json/json_generator_test.rb b/test/json/json_generator_test.rb
index ee19fa5e6c..13d3b5ab91 100644..100755
--- a/test/json/json_generator_test.rb
+++ b/test/json/json_generator_test.rb
@@ -174,6 +174,7 @@ EOT
:ascii_only => false,
:buffer_initial_length => 1024,
:depth => 0,
+ :escape_slash => false,
:indent => " ",
:max_nesting => 100,
:object_nl => "\n",
@@ -190,6 +191,7 @@ EOT
:ascii_only => false,
:buffer_initial_length => 1024,
:depth => 0,
+ :escape_slash => false,
:indent => "",
:max_nesting => 100,
:object_nl => "",
@@ -206,6 +208,7 @@ EOT
:ascii_only => false,
:buffer_initial_length => 1024,
:depth => 0,
+ :escape_slash => false,
:indent => "",
:max_nesting => 0,
:object_nl => "",
@@ -394,6 +397,10 @@ EOT
json = '["/"]'
assert_equal json, generate(data)
#
+ data = [ '/' ]
+ json = '["\/"]'
+ assert_equal json, generate(data, :escape_slash => true)
+ #
data = ['"']
json = '["\""]'
assert_equal json, generate(data)
diff --git a/test/json/json_parser_test.rb b/test/json/json_parser_test.rb
index 9946dd93e7..514441efce 100644
--- a/test/json/json_parser_test.rb
+++ b/test/json/json_parser_test.rb
@@ -293,6 +293,10 @@ EOT
json = '["\\\'"]'
data = ["'"]
assert_equal data, parse(json)
+
+ json = '["\/"]'
+ data = [ '/' ]
+ assert_equal data, parse(json)
end
class SubArray < Array