ruby-changes:24466
From: nobu <ko1@a...>
Date: Tue, 24 Jul 2012 13:24:36 +0900 (JST)
Subject: [ruby-changes:24466] nobu:r36517 (trunk): test_pack.rb: fix assertion
nobu 2012-07-24 13:24:20 +0900 (Tue, 24 Jul 2012) New Revision: 36517 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=36517 Log: test_pack.rb: fix assertion * pack.c (pack_unpack): fix indent. * test/ruby/test_pack.rb (test_pack_unpack_M): fix assertion. ignore invalid quoted-printable and just skip. Modified files: trunk/pack.c trunk/test/ruby/test_pack.rb Index: pack.c =================================================================== --- pack.c (revision 36516) +++ pack.c (revision 36517) @@ -2004,8 +2004,8 @@ while (s < send) { if (*s == '=') { if (++s == send) break; - if (s+1 < send && *s == '\r' && *(s+1) == '\n') - s++; + if (s+1 < send && *s == '\r' && *(s+1) == '\n') + s++; if (*s != '\n') { if ((c1 = hex2num(*s)) == -1) break; if (++s == send) break; Index: test/ruby/test_pack.rb =================================================================== --- test/ruby/test_pack.rb (revision 36516) +++ test/ruby/test_pack.rb (revision 36517) @@ -572,9 +572,8 @@ assert_equal(["a"*1023], (("a"*73+"=\n")*14+"a=\n").unpack("M")) assert_equal(["\x0a"], "=0a=\n".unpack("M")) assert_equal(["\x0a"], "=0A=\n".unpack("M")) - assert_equal([""], "=0Z=\n".unpack("M")) + assert_equal(["=0Z=\n"], "=0Z=\n".unpack("M")) assert_equal([""], "=\r\n".unpack("M")) - assert_equal([""], "=\r\n".unpack("M")) assert_equal(["\xC6\xF7"], "=C6=F7".unpack('M*')) assert_equal(["pre123after"], "pre=31=32=33after".unpack("M")) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/