Array#uniq does not work with custom objects that define eql? and hash
----------------------------------------------------------------------

                 Key: JRUBY-3495
                 URL: http://jira.codehaus.org/browse/JRUBY-3495
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
         Environment: jruby 1.3.0 (ruby 1.8.6 patchlevel 287) (2009-03-13 rev 
6586) [i386-java]


            Reporter: Stephen Bannasch
         Attachments: 
0001-extended-test-for-Array-uniq-to-objects-that-define.patch

Array#uniq doesn't work for Object that define their own eql? and hash methods.

If valid this should probably go into rubyspecs.

{code}
$ ruby 
/Users/stephen/dev/ruby/src/jruby.git/test/externals/ruby_test/test/core/Array/instance/tc_uniq.rb
 
Loaded suite 
/Users/stephen/dev/ruby/src/jruby.git/test/externals/ruby_test/test/core/Array/instance/tc_uniq
Started
.....
Finished in 0.000922 seconds.

5 tests, 15 assertions, 0 failures, 0 errors
[jruby.git (master)]$ jruby 
/Users/stephen/dev/ruby/src/jruby.git/test/externals/ruby_test/test/core/Array/instance/tc_uniq.rb
 
Loaded suite 
/Users/stephen/dev/ruby/src/jruby.git/test/externals/ruby_test/test/core/Array/instance/tc_uniq
Started
....F
Finished in 0.125 seconds.

  1) Failure:
test_uniq_objects(TC_Array_Uniq_Instance) 
[/Users/stephen/dev/ruby/src/jruby.git/test/externals/ruby_test/test/core/Array/instance/tc_uniq.rb:48]:
<1> expected but was
<2>.

5 tests, 15 assertions, 1 failures, 0 errors
{code}

-- 
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