diff options
Diffstat (limited to 'spec/ruby/core/string/unpack/shared/float.rb')
| -rw-r--r-- | spec/ruby/core/string/unpack/shared/float.rb | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/spec/ruby/core/string/unpack/shared/float.rb b/spec/ruby/core/string/unpack/shared/float.rb index ccddf94f99..b31c2c8bdc 100644 --- a/spec/ruby/core/string/unpack/shared/float.rb +++ b/spec/ruby/core/string/unpack/shared/float.rb @@ -1,4 +1,4 @@ -# -*- encoding: binary -*- +# encoding: binary describe :string_unpack_float_le, shared: true do it "decodes one float for a single format character" do @@ -58,8 +58,10 @@ describe :string_unpack_float_le, shared: true do ruby_version_is ""..."3.3" do it "ignores NULL bytes between directives" do - array = "\x9a\x999@33\xb3?".unpack(unpack_format("\000", 2)) - array.should == [2.9000000953674316, 1.399999976158142] + suppress_warning do + array = "\x9a\x999@33\xb3?".unpack(unpack_format("\000", 2)) + array.should == [2.9000000953674316, 1.399999976158142] + end end end @@ -135,8 +137,10 @@ describe :string_unpack_float_be, shared: true do ruby_version_is ""..."3.3" do it "ignores NULL bytes between directives" do - array = "@9\x99\x9a?\xb333".unpack(unpack_format("\000", 2)) - array.should == [2.9000000953674316, 1.399999976158142] + suppress_warning do + array = "@9\x99\x9a?\xb333".unpack(unpack_format("\000", 2)) + array.should == [2.9000000953674316, 1.399999976158142] + end end end @@ -215,7 +219,9 @@ describe :string_unpack_double_le, shared: true do ruby_version_is ""..."3.3" do it "ignores NULL bytes between directives" do - "333333\x07@ffffff\xf6?".unpack(unpack_format("\000", 2)).should == [2.9, 1.4] + suppress_warning do + "333333\x07@ffffff\xf6?".unpack(unpack_format("\000", 2)).should == [2.9, 1.4] + end end end @@ -293,7 +299,9 @@ describe :string_unpack_double_be, shared: true do ruby_version_is ""..."3.3" do it "ignores NULL bytes between directives" do - "@\x07333333?\xf6ffffff".unpack(unpack_format("\000", 2)).should == [2.9, 1.4] + suppress_warning do + "@\x07333333?\xf6ffffff".unpack(unpack_format("\000", 2)).should == [2.9, 1.4] + end end end |
