summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string/unpack/shared/integer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/string/unpack/shared/integer.rb')
-rw-r--r--spec/ruby/core/string/unpack/shared/integer.rb30
1 files changed, 21 insertions, 9 deletions
diff --git a/spec/ruby/core/string/unpack/shared/integer.rb b/spec/ruby/core/string/unpack/shared/integer.rb
index ba4f149dad..d3934753ba 100644
--- a/spec/ruby/core/string/unpack/shared/integer.rb
+++ b/spec/ruby/core/string/unpack/shared/integer.rb
@@ -1,4 +1,4 @@
-# -*- encoding: binary -*-
+# encoding: binary
describe :string_unpack_16bit_le, shared: true do
it "decodes one short for a single format character" do
@@ -34,7 +34,9 @@ describe :string_unpack_16bit_le, shared: true do
ruby_version_is ""..."3.3" do
it "ignores NULL bytes between directives" do
- "abcd".unpack(unpack_format("\000", 2)).should == [25185, 25699]
+ suppress_warning do
+ "abcd".unpack(unpack_format("\000", 2)).should == [25185, 25699]
+ end
end
end
@@ -97,7 +99,9 @@ describe :string_unpack_16bit_be, shared: true do
ruby_version_is ""..."3.3" do
it "ignores NULL bytes between directives" do
- "badc".unpack(unpack_format("\000", 2)).should == [25185, 25699]
+ suppress_warning do
+ "badc".unpack(unpack_format("\000", 2)).should == [25185, 25699]
+ end
end
end
@@ -161,7 +165,9 @@ describe :string_unpack_32bit_le, shared: true do
ruby_version_is ""..."3.3" do
it "ignores NULL bytes between directives" do
- "abcdefgh".unpack(unpack_format("\000", 2)).should == [1684234849, 1751606885]
+ suppress_warning do
+ "abcdefgh".unpack(unpack_format("\000", 2)).should == [1684234849, 1751606885]
+ end
end
end
@@ -225,7 +231,9 @@ describe :string_unpack_32bit_be, shared: true do
ruby_version_is ""..."3.3" do
it "ignores NULL bytes between directives" do
- "dcbahgfe".unpack(unpack_format("\000", 2)).should == [1684234849, 1751606885]
+ suppress_warning do
+ "dcbahgfe".unpack(unpack_format("\000", 2)).should == [1684234849, 1751606885]
+ end
end
end
@@ -285,8 +293,10 @@ describe :string_unpack_64bit_le, shared: true do
ruby_version_is ""..."3.3" do
it "ignores NULL bytes between directives" do
- array = "abcdefghabghefcd".unpack(unpack_format("\000", 2))
- array.should == [7523094288207667809, 7233738012216484449]
+ suppress_warning do
+ array = "abcdefghabghefcd".unpack(unpack_format("\000", 2))
+ array.should == [7523094288207667809, 7233738012216484449]
+ end
end
end
@@ -357,8 +367,10 @@ describe :string_unpack_64bit_be, shared: true do
ruby_version_is ""..."3.3" do
it "ignores NULL bytes between directives" do
- array = "hgfedcbadcfehgba".unpack(unpack_format("\000", 2))
- array.should == [7523094288207667809, 7233738012216484449]
+ suppress_warning do
+ array = "hgfedcbadcfehgba".unpack(unpack_format("\000", 2))
+ array.should == [7523094288207667809, 7233738012216484449]
+ end
end
end