Revision: 2691 http://trac.macosforge.org/projects/ruby/changeset/2691 Author: mattaimonetti@gmail.com Date: 2009-09-30 14:30:39 -0700 (Wed, 30 Sep 2009) Log Message: ----------- fixed an Array pack spec when using format = 'v' thanks to Ninh Bui aka Patrick Hernandez Bui (Phusion) When format = "v", it should use little endianness for the short, i.e. least significant byte should be first. So in this case, it should be \x01\x00 Modified Paths: -------------- MacRuby/trunk/spec/frozen/core/array/pack_spec.rb MacRuby/trunk/spec/frozen/tags/macruby/core/array/pack_tags.txt Modified: MacRuby/trunk/spec/frozen/core/array/pack_spec.rb =================================================================== --- MacRuby/trunk/spec/frozen/core/array/pack_spec.rb 2009-09-30 14:45:26 UTC (rev 2690) +++ MacRuby/trunk/spec/frozen/core/array/pack_spec.rb 2009-09-30 21:30:39 UTC (rev 2691) @@ -714,7 +714,7 @@ it "does not raise a RangeError even when a pack argument is >= 2**64" do [2**64-1].pack(format).should == binary("\xFF\xFF") [2**64 ].pack(format).should == binary("\x00\x00") - [2**64+1].pack(format).should == binary("\x00\x01") + [2**64+1].pack(format).should == binary("\x01\x00") end it "does not raise a RangeError even when a pack argument is <= -2**64" do Modified: MacRuby/trunk/spec/frozen/tags/macruby/core/array/pack_tags.txt =================================================================== --- MacRuby/trunk/spec/frozen/tags/macruby/core/array/pack_tags.txt 2009-09-30 14:45:26 UTC (rev 2690) +++ MacRuby/trunk/spec/frozen/tags/macruby/core/array/pack_tags.txt 2009-09-30 21:30:39 UTC (rev 2691) @@ -7,7 +7,7 @@ fails:Array#pack with format 'Z' cuts byte sequence even if it breaks a multibyte character fails:Array#pack with format 'H' fills low-nibble of the last byte with 0 when count is odd even if pack argument has insufficient length fails:Array#pack with format 'h' fills high-nibble of the last byte with 0 when count is odd even if pack argument has insufficient length -fails:Array#pack with format 'v' does not raise a RangeError even when a pack argument is >= 2**64 +#fails:Array#pack with format 'v' does not raise a RangeError even when a pack argument is >= 2**64 fails:Array#pack with format 's!' does not raise a RangeError even when a pack argument is >= 2**64 fails:Array#pack with format 's_' does not raise a RangeError even when a pack argument is >= 2**64 fails:Array#pack with format 'S!' does not raise a RangeError even when a pack argument is >= 2**64
participants (1)
-
source_changes@macosforge.org