summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorJean Boussier <byroot@ruby-lang.org>2024-02-19 13:35:48 +0100
committerJean Boussier <jean.boussier@gmail.com>2024-04-18 10:17:26 +0200
commit3a7846b1aa4c10d86dc5a91c6df94f89d60bb0c3 (patch)
treefe189c035b6b7ede818b3d644c897ce0001d4916 /test/ruby
parentb3c59370ca20fcde2fde5a63361550c04ca44be3 (diff)
Add a hint of `ASCII-8BIT` being `BINARY`
[Feature #18576] Since outright renaming `ASCII-8BIT` is deemed to backward incompatible, the next best thing would be to only change its `#inspect`, particularly in exception messages.
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_m17n.rb4
-rw-r--r--test/ruby/test_yjit.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb
index 907360b3a6..a6493374b5 100644
--- a/test/ruby/test_m17n.rb
+++ b/test/ruby/test_m17n.rb
@@ -1091,7 +1091,7 @@ class TestM17N < Test::Unit::TestCase
assert_nil(e("\xa1\xa2\xa3\xa4").rindex(e("\xa3")))
s = e("\xa3\xb0\xa3\xb1\xa3\xb2\xa3\xb3\xa3\xb4")
- a_with_e = /EUC-JP and ASCII-8BIT/
+ a_with_e = /EUC-JP and BINARY \(ASCII-8BIT\)/
assert_raise_with_message(Encoding::CompatibilityError, a_with_e) do
s.index(a("\xb1\xa3"))
end
@@ -1099,7 +1099,7 @@ class TestM17N < Test::Unit::TestCase
s.rindex(a("\xb1\xa3"))
end
- a_with_e = /ASCII-8BIT regexp with EUC-JP string/
+ a_with_e = /BINARY \(ASCII-8BIT\) regexp with EUC-JP string/
assert_raise_with_message(Encoding::CompatibilityError, a_with_e) do
s.index(Regexp.new(a("\xb1\xa3")))
end
diff --git a/test/ruby/test_yjit.rb b/test/ruby/test_yjit.rb
index df71dbffc0..796787e355 100644
--- a/test/ruby/test_yjit.rb
+++ b/test/ruby/test_yjit.rb
@@ -1458,7 +1458,7 @@ class TestYJIT < Test::Unit::TestCase
end
def test_str_concat_encoding_mismatch
- assert_compiles(<<~'RUBY', result: "incompatible character encodings: ASCII-8BIT and EUC-JP")
+ assert_compiles(<<~'RUBY', result: "incompatible character encodings: BINARY (ASCII-8BIT) and EUC-JP")
def bar(a, b)
a << b
rescue => e