summaryrefslogtreecommitdiff
path: root/test/ruby/test_marshal.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-09-23 00:04:14 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-09-23 00:07:17 +0900
commit552728a23aeab0df598b356b19a573259e297d14 (patch)
tree95fd4af73e3e5c6ef6a42b6e7b1a464238876126 /test/ruby/test_marshal.rb
parent357406da8b463978b6db68ef5672b76067506c64 (diff)
Check the encoding of `ruby2_keywords_flag` [Bug #18184]
Diffstat (limited to 'test/ruby/test_marshal.rb')
-rw-r--r--test/ruby/test_marshal.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb
index 619aaa6736..9eea3c272e 100644
--- a/test/ruby/test_marshal.rb
+++ b/test/ruby/test_marshal.rb
@@ -810,7 +810,11 @@ class TestMarshal < Test::Unit::TestCase
hash = Marshal.load(data)
assert_equal(42, ruby2_keywords_test(*[hash]))
- hash2 = Marshal.load(data.sub!(/\x06K(?=T\z)/, "\x08KEY"))
+ hash2 = Marshal.load(data.sub(/\x06K(?=T\z)/, "\x08KEY"))
+ assert_raise(ArgumentError, /\(given 1, expected 0\)/) {
+ ruby2_keywords_test(*[hash2])
+ }
+ hash2 = Marshal.load(data.sub(/:\x06K(?=T\z)/, "I\\&\x06:\x0dencoding\"\x0dUTF-16LE"))
assert_raise(ArgumentError, /\(given 1, expected 0\)/) {
ruby2_keywords_test(*[hash2])
}