Array#repeated_permutation(n) enumerates nothing when n is greater than the 
length
----------------------------------------------------------------------------------

                 Key: JRUBY-6048
                 URL: https://jira.codehaus.org/browse/JRUBY-6048
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
            Reporter: Yusuke Endoh
         Attachments: repeated_permutation.patch

$ ruby -ve 'p [1,2].repeated_permutation(3).to_a'
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
[[1, 1, 1], [1, 1, 2], [1, 2, 1], [1, 2, 2], [2, 1, 1], [2, 1, 2], [2, 2, 1], 
[2, 2, 2]]

$ jruby --1.9 -e 'p [1,2].repeated_permutation(3).to_a'
[]


A patch is attached.


FYI, I found this bug by executing CRuby's test/ruby/test_array.rb :-)
In fact, it DOES run, though it emits many errors/failures because of
JRuby's lack of support for $SAFE, full continuation, auto-synchronized
array, etc.

-- 
Yusuke Endoh <m...@tsg.ne.jp>

--
This message is automatically generated by JIRA.
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