Skip to content

Commit b22fd7c

Browse files
tompnghsbt
authored andcommitted
[ruby/json] Fix sliced string escaping
ruby/json@d7baf015d9
1 parent 7046772 commit b22fd7c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/json/json_encoding_test.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ def test_generate_shared_string
3535
# Ref: https://github.com/ruby/json/issues/859
3636
s = "01234567890"
3737
assert_equal '"234567890"', JSON.dump(s[2..-1])
38+
s = '01234567890123456789"a"b"c"d"e"f"g"h'
39+
assert_equal '"\"a\"b\"c\"d\"e\"f\"g\""', JSON.dump(s[20, 15])
3840
end
3941

4042
def test_unicode

0 commit comments

Comments
 (0)