Funny.  About a month ago I fixed this for a test below it
for Range (which had the same error).  The same Regexps are supposed 
to hash the same.  We will need to fix this.  Based on the test
itself, it makes me wonder if the hashing behavior changed between
1.6 and 1.8 of Ruby?

-Tom

On Sat, 17 Jun 2006, Ola Bini defenestrated me:
>
> Hi,
> 
> When doing a test of my recent changes with hashCode, I got an assertion 
> failure from TestRubyHash:
>          result = eval("key = /a/; hash = {key => 'one'}; hash[/a/] = 
> 'two'; puts hash[key]")
>          assertEquals("one", result);
> 
> According to the comments I suspect this is a test of identity for regexps, 
> but the test result expected doesn't match what my C Ruby does, which means 
> it have to be an error in the test:
> 
> irb(main):001:0> key = /a/
> key = /a/
> /a/
> irb(main):002:0> hash = {key => 'one'}
> hash = {key => 'one'}
> {/a/=>"one"}
> irb(main):003:0> hash[/a/] = 'two'
> hash[/a/] = 'two'
> "two"
> irb(main):004:0> puts hash[key]
> puts hash[key]
> two
> nil
> 
> 
> So, according to this, line 92 in test/org/jruby/test/TestRubyHash.java 
> should be changed from
>          assertEquals("one", result);
> into
>          assertEquals("two", result);
> 
> ... Regards
>   Ola Bini
> 
> 
> 
> 
> _______________________________________________
> Jruby-devel mailing list
> Jruby-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jruby-devel

-- 
+ http://www.tc.umn.edu/~enebo +---- mailto:[EMAIL PROTECTED] ----+
| Thomas E Enebo, Protagonist  | "Luck favors the prepared    |
|                              |  mind." -Louis Pasteur       |


_______________________________________________
Jruby-devel mailing list
Jruby-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jruby-devel

Reply via email to