summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string
diff options
authorAndrew Konchin <[email protected]>2024-12-09 20:32:39 +0200
committerBenoit Daloze <[email protected]>2024-12-10 14:38:52 +0100
commitde5df203bcfb228b7043ae0116535953c325ddb4 (patch)
treea3b8b89d3010cc554fdb1df2720e81be41357787 /spec/ruby/core/string
parenta90d8c335a6f5f2ae0c9480c9a546089f52e9028 (diff)
Update to ruby/spec@9f10222
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12297
Diffstat (limited to 'spec/ruby/core/string')
-rw-r--r--spec/ruby/core/string/unpack/shared/basic.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/ruby/core/string/unpack/shared/basic.rb b/spec/ruby/core/string/unpack/shared/basic.rb
index bb5302edc5..b37a447683 100644
--- a/spec/ruby/core/string/unpack/shared/basic.rb
+++ b/spec/ruby/core/string/unpack/shared/basic.rb
@@ -8,6 +8,15 @@ describe :string_unpack_basic, shared: true do
d.should_receive(:to_str).and_return("a"+unpack_format)
"abc".unpack(d).should be_an_instance_of(Array)
end
+
+ ruby_version_is "3.3" do
+ # https://bugs.ruby-lang.org/issues/19150
+ it 'raise ArgumentError when a directive is unknown' do
+ -> { "abcdefgh".unpack("a R" + unpack_format) }.should raise_error(ArgumentError, /unknown unpack directive 'R'/)
+ -> { "abcdefgh".unpack("a 0" + unpack_format) }.should raise_error(ArgumentError, /unknown unpack directive '0'/)
+ -> { "abcdefgh".unpack("a :" + unpack_format) }.should raise_error(ArgumentError, /unknown unpack directive ':'/)
+ end
+ end
end
describe :string_unpack_no_platform, shared: true do