JRuby

Zlib::GzipReader.each_line yields compressed data

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: JRuby 1.2
  • Component/s: Core Classes/Modules
  • Labels:
    None
  • Environment:
    OSX Leopard
    % uname -a
    Darwin macguffin.infloop.com 9.5.0 Darwin Kernel Version 9.5.0: Wed Sep 3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386 i386
  • Testcase included:
    yes
  • Number of attachments :
    3

Description

If I add the attached test cases to test/test_zlib.rb, it passes with MRI, but fails with jruby.

It fails both on linux with 1.1.6RC1 and on darwin with the trunk
linux% jruby -v
jruby 1.1.6RC1 (ruby 1.8.6 patchlevel 114) (2008-12-03 rev 8263) [amd64-java]
darwin% jruby -v
jruby 1.1.7 (ruby 1.8.6 patchlevel 114) (2008-12-11 rev 8313) [i386-java]

% jruby test/test_zlib.rb
Loaded suite test/test_zlib
Started
..FF......
Finished in 0.838891 seconds.

1) Failure:
test_each(TestZlib) [test/test_zlib.rb:139]:
<"hello\n"> expected but was
<"\313H\315\311\311\347*\317/\312I\341\002\000\377]\305\304\f\000\000\000">.

2) Failure:
test_each_line(TestZlib) [test/test_zlib.rb:126]:
<"hello\n"> expected but was
<"\313H\315\311\311\347*\317/\312I\341\002\000\377]\305\304\f\000\000\000">.

10 tests, 16 assertions, 2 failures, 0 errors

% ruby test/test_zlib.rb [1]
Loaded suite test/test_zlib
Started
..........
Finished in 0.104118 seconds.

10 tests, 18 assertions, 0 failures, 0 errors

  1. test_zlib.patch
    11/Dec/08 9:01 AM
    0.9 kB
    ahobson
  2. zlib.patch
    11/Dec/08 12:02 PM
    7 kB
    ahobson
  3. zlib-try2.patch
    11/Dec/08 12:20 PM
    7 kB
    ahobson

Activity

Hide
ahobson added a comment -

The attached patch fixes the issue for me. I modified the test cases to be a bit more thorough.

Show
ahobson added a comment - The attached patch fixes the issue for me. I modified the test cases to be a bit more thorough.
Hide
ahobson added a comment -

Fix one bug and create another. Last patch didn't handle empty lines correctly. New patch supercedes zlib.patch and contains another test case.

Show
ahobson added a comment - Fix one bug and create another. Last patch didn't handle empty lines correctly. New patch supercedes zlib.patch and contains another test case.
Hide
Thomas E Enebo added a comment -

Resolved in commit 8381 (patch by ahobson)

Show
Thomas E Enebo added a comment - Resolved in commit 8381 (patch by ahobson)

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: