String#unpack('M') produces wrong results when multiple lines are involved
--------------------------------------------------------------------------

                 Key: JRUBY-4647
                 URL: http://jira.codehaus.org/browse/JRUBY-4647
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules, Intro, RubySpec
    Affects Versions: JRuby 1.4
            Reporter: Vladimir Sizikov


JRuby:

{noformat}
jruby -e "p %Q{foo=\r\nbar}.unpack('M').first" ==> "foo"
{noformat}

Other impls:

{noformat}
pik ruby -e "p %Q{foo=\r\nbar}.unpack('M').first"
IronRuby 0.9.3.0 on .NET 2.0.0.0

"foobar"

ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]

"foobar"

ruby 1.8.6 (2009-08-04 patchlevel 383) [i386-mingw32]

"foobar"

ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-cygwin]

"foobar"

ruby 1.8.7 (2009-06-12 patchlevel 174) [i386-mswin32]

"foobar"

ruby 1.9.0 (2008-06-20 revision 17482) [i386-mswin32]

"foobar"

ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-mswin32]

"foobar"

ruby 1.9.1p0 (2009-01-30 revision 21907) [x64-mswin64_80]

"foobar"

ruby 1.9.1p129 (2009-05-12 revision 23412) [i386-mswin32]

"foobar"

ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32]

"foobar"

ruby 1.9.2dev (2009-07-18) [i386-mswin32]

"foobar"

ruby 1.9.2dev (2009-11-12 trunk 25723) [i386-mingw32]

"foobar"

ruby 1.9.2dev (2010-02-28 trunk 26782) [i386-mingw32]

"foobar"

ruby 1.9.2dev (2010-03-05 trunk 26821) [i386-mingw32]

"foobar"
{noformat}

This also causes one new rubyspec failure:

{noformat}
String#unpack with 'M' directive decodes across new lines FAILED
Expected "A fax has arrived from remote ID ''.\r\n-----------------------"
to equal "A fax has arrived from remote ID 
''.\r\n------------------------------------------------------------\r\nTime:
 3/9/2006 3:50:52 PM\r\nReceived from remote ID: \r\nInbound user ID 
XXXXXXXXXX, routing code XXXXXXXXX\r\nResult:
(0/352;0/0) Successful Send\r\nPage record: 1 - 1\r\nElapsed time: 00:58 on 
channel 11\r\n"

/opt/work/rubyspec.git/core/string/unpack_spec.rb:482
/opt/work/rubyspec.git/core/string/unpack_spec.rb:457
/opt/work/rubyspec.git/core/string/unpack_spec.rb:56:in `load'
/opt/work/mspec.git/bin/mspec-ci:8
{noformat}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to