1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
From: Cédric Boutillier <boutil@debian.org>
Date: Tue, 23 Jun 2020 15:24:57 +0200
Subject: Bignum and Fixnum are deprecated
This causes 2 warnings and 1 test failure on ruby2.7
replacing with Integer when possible
In the lastch chunk, assert_equal has been replaced by assert_match because
the generic_class_writer creates two lines of comments about encoding and
validity, which are here ignored
Forwarded: https://github.com/marcandre/packable/pull/14
---
test/packing_test.rb | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/test/packing_test.rb b/test/packing_test.rb
index 007f8e4..0ac7070 100644
--- a/test/packing_test.rb
+++ b/test/packing_test.rb
@@ -55,7 +55,6 @@ class TestingPack < Minitest::Test
assert_equal 1.pack(:long), ((1 << 69) + 1).pack(:long)
assert_equal "*" + ("\000" * 15), (42 << (8*15)).pack(:bytes => 16)
assert_equal 42 << (8*15), (42 << (8*15)).pack(:bytes => 16).unpack(Integer, :bytes => 16)
- assert_equal 42 << (8*15), (42 << (8*15)).pack(:bytes => 16).unpack(Bignum, :bytes => 16)
end
def test_float
@@ -69,7 +68,7 @@ class TestingPack < Minitest::Test
def test_io
io = StringIO.new("\000\000\000\006abcdE!")
- n, s, c = io >> [Fixnum, {:signed=>false}] >> [String, {:bytes => 4}] >> :char
+ n, s, c = io >> [Integer, {:signed=>false}] >> [String, {:bytes => 4}] >> :char
assert_equal 6, n
assert_equal "abcd", s
assert_equal 69, c
@@ -120,7 +119,7 @@ class TestingPack < Minitest::Test
end
should "be follow accessible everywhere" do
assert_equal "StringHello", "Hello".pack(:generic_class_writer)
- assert_equal "Fixnum\000\000\000\006", 6.pack(:generic_class_writer)
+ assert_match /Integer\x00\x00\x00\x06$/, 6.pack(:generic_class_writer)
end
end
context "for a specific class" do
|