Project

General

Profile

Bug #10025 » pack-m-width-output.patch

jeremyevans0 (Jeremy Evans), 07/10/2019 04:36 AM

View differences:

pack.c
len = 45;
else if (len > 63 && type == 'u')
len = 63;
else
else if (type == 'u')
len = len / 3 * 3;
else
len = len / 4 * 3;
while (plen > 0) {
long todo;
test/ruby/test_pack.rb
assert_raise(ArgumentError) { "AAB=".unpack("m0") }
end
def test_pack_unpack_m60
assert_equal("/"*40 + "\n" + "/"*24 + "\n", ["\377"*48].pack("m40"))
assert_equal("/"*48 + "\n" + "/"*16 + "\n", ["\377"*48].pack("m50"))
assert_equal("/"*60 + "\n" + "/"*4 + "\n", ["\377"*48].pack("m60"))
end
def test_pack_unpack_M
assert_equal("a b c\td =\n\ne=\n", ["a b c\td \ne"].pack("M"))
assert_equal(["a b c\td \ne"], "a b c\td =\n\ne=\n".unpack("M"))
(2-2/2)