From b22fd7c40d875b136693d53bcd36e756feef2c6d Mon Sep 17 00:00:00 2001 From: tompng Date: Sun, 5 Oct 2025 02:26:46 +0900 Subject: [ruby/json] Fix sliced string escaping https://github.com/ruby/json/commit/d7baf015d9 --- test/json/json_encoding_test.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/json/json_encoding_test.rb b/test/json/json_encoding_test.rb index 8dce81da59..2789e94b5b 100644 --- a/test/json/json_encoding_test.rb +++ b/test/json/json_encoding_test.rb @@ -35,6 +35,8 @@ class JSONEncodingTest < Test::Unit::TestCase # Ref: https://github.com/ruby/json/issues/859 s = "01234567890" assert_equal '"234567890"', JSON.dump(s[2..-1]) + s = '01234567890123456789"a"b"c"d"e"f"g"h' + assert_equal '"\"a\"b\"c\"d\"e\"f\"g\""', JSON.dump(s[20, 15]) end def test_unicode -- cgit v1.2.3