diff options
| author | Étienne Barrié <etienne.barrie@gmail.com> | 2025-09-08 15:22:21 +0200 |
|---|---|---|
| committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2025-09-11 11:54:49 +0900 |
| commit | 0438b77cf64b4dba31e2c412f7da10b39b5072eb (patch) | |
| tree | 715e0b5c2c23fe0761230a1d7be3dac0d7e4286a | |
| parent | b19b4b7b2ac3b1521c99db2d07a6743ea43161fd (diff) | |
[ruby/json] Stop checking for String#@-
https://github.com/ruby/json/commit/a9e05d6ff3
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
| -rw-r--r-- | test/json/json_parser_test.rb | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/test/json/json_parser_test.rb b/test/json/json_parser_test.rb index 45474c9820..2217f2b9e8 100644 --- a/test/json/json_parser_test.rb +++ b/test/json/json_parser_test.rb @@ -397,10 +397,8 @@ class JSONParserTest < Test::Unit::TestCase assert_predicate parse('[]', :freeze => true), :frozen? assert_predicate parse('"foo"', :freeze => true), :frozen? - if string_deduplication_available? - assert_same(-'foo', parse('"foo"', :freeze => true)) - assert_same(-'foo', parse('{"foo": 1}', :freeze => true).keys.first) - end + assert_same(-'foo', parse('"foo"', :freeze => true)) + assert_same(-'foo', parse('{"foo": 1}', :freeze => true).keys.first) end def test_parse_comments @@ -794,16 +792,6 @@ class JSONParserTest < Test::Unit::TestCase private - def string_deduplication_available? - r1 = rand.to_s - r2 = r1.dup - begin - (-r1).equal?(-r2) - rescue NoMethodError - false # No String#-@ - end - end - def assert_equal_float(expected, actual, delta = 1e-2) Array === expected and expected = expected.first Array === actual and actual = actual.first |
