summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string/unpack/shared/integer.rb
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2026-01-28 22:30:21 +0100
committerBenoit Daloze <eregontp@gmail.com>2026-01-28 23:01:22 +0100
commitdbd2ff7adca9b49e4bfa7bc3ec8b83bd437f8cb7 (patch)
tree5f4f1609d2015fde92c25b175b84078dfcf1c92f /spec/ruby/core/string/unpack/shared/integer.rb
parenta8b877a843643fbdccd1a42efaf94ad27705dd55 (diff)
Update to ruby/spec@83e26c9
Diffstat (limited to 'spec/ruby/core/string/unpack/shared/integer.rb')
-rw-r--r--spec/ruby/core/string/unpack/shared/integer.rb110
1 files changed, 24 insertions, 86 deletions
diff --git a/spec/ruby/core/string/unpack/shared/integer.rb b/spec/ruby/core/string/unpack/shared/integer.rb
index d3934753ba..eb99456225 100644
--- a/spec/ruby/core/string/unpack/shared/integer.rb
+++ b/spec/ruby/core/string/unpack/shared/integer.rb
@@ -32,20 +32,10 @@ describe :string_unpack_16bit_le, shared: true do
].should be_computed_by(:unpack, unpack_format(3))
end
- ruby_version_is ""..."3.3" do
- it "ignores NULL bytes between directives" do
- suppress_warning do
- "abcd".unpack(unpack_format("\000", 2)).should == [25185, 25699]
- end
- end
- end
-
- ruby_version_is "3.3" do
- it "raise ArgumentError for NULL bytes between directives" do
- -> {
- "abcd".unpack(unpack_format("\000", 2))
- }.should raise_error(ArgumentError, /unknown unpack directive/)
- end
+ it "raise ArgumentError for NULL bytes between directives" do
+ -> {
+ "abcd".unpack(unpack_format("\000", 2))
+ }.should raise_error(ArgumentError, /unknown unpack directive/)
end
it "ignores spaces between directives" do
@@ -97,20 +87,10 @@ describe :string_unpack_16bit_be, shared: true do
].should be_computed_by(:unpack, unpack_format(3))
end
- ruby_version_is ""..."3.3" do
- it "ignores NULL bytes between directives" do
- suppress_warning do
- "badc".unpack(unpack_format("\000", 2)).should == [25185, 25699]
- end
- end
- end
-
- ruby_version_is "3.3" do
- it "raise ArgumentError for NULL bytes between directives" do
- -> {
- "badc".unpack(unpack_format("\000", 2))
- }.should raise_error(ArgumentError, /unknown unpack directive/)
- end
+ it "raise ArgumentError for NULL bytes between directives" do
+ -> {
+ "badc".unpack(unpack_format("\000", 2))
+ }.should raise_error(ArgumentError, /unknown unpack directive/)
end
it "ignores spaces between directives" do
@@ -163,20 +143,10 @@ describe :string_unpack_32bit_le, shared: true do
].should be_computed_by(:unpack, unpack_format(3))
end
- ruby_version_is ""..."3.3" do
- it "ignores NULL bytes between directives" do
- suppress_warning do
- "abcdefgh".unpack(unpack_format("\000", 2)).should == [1684234849, 1751606885]
- end
- end
- end
-
- ruby_version_is "3.3" do
- it "raise ArgumentError for NULL bytes between directives" do
- -> {
- "abcdefgh".unpack(unpack_format("\000", 2))
- }.should raise_error(ArgumentError, /unknown unpack directive/)
- end
+ it "raise ArgumentError for NULL bytes between directives" do
+ -> {
+ "abcdefgh".unpack(unpack_format("\000", 2))
+ }.should raise_error(ArgumentError, /unknown unpack directive/)
end
it "ignores spaces between directives" do
@@ -229,20 +199,10 @@ describe :string_unpack_32bit_be, shared: true do
].should be_computed_by(:unpack, unpack_format(3))
end
- ruby_version_is ""..."3.3" do
- it "ignores NULL bytes between directives" do
- suppress_warning do
- "dcbahgfe".unpack(unpack_format("\000", 2)).should == [1684234849, 1751606885]
- end
- end
- end
-
- ruby_version_is "3.3" do
- it "raise ArgumentError for NULL bytes between directives" do
- -> {
- "dcbahgfe".unpack(unpack_format("\000", 2))
- }.should raise_error(ArgumentError, /unknown unpack directive/)
- end
+ it "raise ArgumentError for NULL bytes between directives" do
+ -> {
+ "dcbahgfe".unpack(unpack_format("\000", 2))
+ }.should raise_error(ArgumentError, /unknown unpack directive/)
end
it "ignores spaces between directives" do
@@ -291,21 +251,10 @@ describe :string_unpack_64bit_le, shared: true do
"abc".unpack(unpack_format('*')).should == []
end
- ruby_version_is ""..."3.3" do
- it "ignores NULL bytes between directives" do
- suppress_warning do
- array = "abcdefghabghefcd".unpack(unpack_format("\000", 2))
- array.should == [7523094288207667809, 7233738012216484449]
- end
- end
- end
-
- ruby_version_is "3.3" do
- it "raise ArgumentError for NULL bytes between directives" do
- -> {
- "badc".unpack(unpack_format("\000", 2))
- }.should raise_error(ArgumentError, /unknown unpack directive/)
- end
+ it "raise ArgumentError for NULL bytes between directives" do
+ -> {
+ "badc".unpack(unpack_format("\000", 2))
+ }.should raise_error(ArgumentError, /unknown unpack directive/)
end
it "ignores spaces between directives" do
@@ -365,21 +314,10 @@ describe :string_unpack_64bit_be, shared: true do
"abc".unpack(unpack_format('*')).should == []
end
- ruby_version_is ""..."3.3" do
- it "ignores NULL bytes between directives" do
- suppress_warning do
- array = "hgfedcbadcfehgba".unpack(unpack_format("\000", 2))
- array.should == [7523094288207667809, 7233738012216484449]
- end
- end
- end
-
- ruby_version_is "3.3" do
- it "raise ArgumentError for NULL bytes between directives" do
- -> {
- "hgfedcbadcfehgba".unpack(unpack_format("\000", 2))
- }.should raise_error(ArgumentError, /unknown unpack directive/)
- end
+ it "raise ArgumentError for NULL bytes between directives" do
+ -> {
+ "hgfedcbadcfehgba".unpack(unpack_format("\000", 2))
+ }.should raise_error(ArgumentError, /unknown unpack directive/)
end
it "ignores spaces between directives" do