Affects Version/s: None
Fix Version/s: JRuby 0.9.9
Environment:Using JRuby built from Subversion trunk (revision 3415) on 2007-04-10.
Mac OS X Tiger. Java version 1.5.0_07.
Number of attachments :
Writing large data structures as YAML seem to give incorrect result sometimes. I have not been able to narrow this down to a small example. Instead I give the large testcase "as-is".
I supply the testcase in two formats: 1) traditional "test/unit" testcase, and 2) a Rakefile that will generate the test-vectors as files. This second approach makes it easier (I think) to see what goes wrong.
The second approach works by: 1) let a script generate YAML-files with both CRuby and JRuby. 2) let a CRuby script rewrite the YAML-files to a canonical format (invented for this bug-report). This step is needed to eliminate the different YAML-constructs used by the YAML-library in CRuby and JRuby. 3) compare with diff(1) the files on canonical format. 4) For the YAML-library in JRuby to be OK, there should not be any differences.
The suppiled Rakefile makes running the tests easy:
$ rake gen
$ rake diff
Om my machine the diff-step gives the output below. I would have expected no differences if the YAML-library worked OK in JRuby.
To make the tests use even larger data structures, the constant COUNT in the "gen-yaml-samples.rb" file can be increased.
Below is the output I get on my machine from running the rake-tasks described above.
r -x '*.yaml' build/ruby compare/x/050.yaml.serial build/jruby-compare/x/050.yaml.serial
< String: nn2586
> String: nn2566
r -x '*.yaml' build/ruby compare/y/074.yaml.serial build/jruby-compare/y/074.yaml.serial
< String: BB
> String: bb
r -x '*.yaml' build/ruby compare/y/078.yaml.serial build/jruby-compare/y/078.yaml.serial
< String: nn40933
> String: nn40706