summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string/unpack
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2022-06-26 14:50:14 +0200
committerBenoit Daloze <eregontp@gmail.com>2022-06-26 14:50:14 +0200
commitd3d5ef0cca160fca538c7f556c5a6e08df5847e6 (patch)
tree57358b4b9cdd6f429d0383005ac393cb74dd3bff /spec/ruby/core/string/unpack
parentf616e816372d14e605879d2e43c7fbdda29ef837 (diff)
Update to ruby/spec@ab32a1a
Diffstat (limited to 'spec/ruby/core/string/unpack')
-rw-r--r--spec/ruby/core/string/unpack/z_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/ruby/core/string/unpack/z_spec.rb b/spec/ruby/core/string/unpack/z_spec.rb
index 552851ce04..ce8da4b29e 100644
--- a/spec/ruby/core/string/unpack/z_spec.rb
+++ b/spec/ruby/core/string/unpack/z_spec.rb
@@ -20,4 +20,9 @@ describe "String#unpack with format 'Z'" do
["\x00a\x00 bc \x00", ["", "c"]]
].should be_computed_by(:unpack, "Z5Z")
end
+
+ it "does not advance past the null byte when given a 'Z' format specifier" do
+ "a\x00\x0f".unpack('Zxc').should == ['a', 15]
+ "a\x00\x0f".unpack('Zcc').should == ['a', 0, 15]
+ end
end