# \[1,2,3\].permutation(2).to\_a

**URL:** <https://www.ruby-forum.com/t/1-2-3-permutation-2-to-a/116754>\
**Category:** Development\
**Created:** [October 9, 2007, 11:51am UTC](https://www.ruby-forum.com/t/1-2-3-permutation-2-to-a/116754 "2007-10-09T11:51:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tanaka\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c67d28/32.png) [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Post date:** [October 9, 2007, 11:51am UTC](https://www.ruby-forum.com/t/1-2-3-permutation-2-to-a/116754/1 "2007-10-09T11:51:07Z")

</div>

[1,2,3].permutation(2).to\_a e$B$,e(B [[2, 2], [2, 3]] e$B$K$J$j$^$9!#e(B

% ./ruby -ve ‘p [1,2,3].permutation(2).to\_a’  
ruby 1.9.0 (2007-10-09 patchlevel 0) [i686-linux]  
[[2, 2], [2, 3]]  
% ./ruby test/ruby/test\_array.rb  
Loaded suite test/ruby/test\_array  
Started  
…F…  
Finished in 0.065778 seconds.

1. Failure:  
test\_permutation(TestArray) [test/ruby/test\_array.rb:1205]:  
\<[[1, 2], [1, 3], [2, 1], [2, 3], [3, 1], [3, 2]]\> expected but was  
\<[[2, 2], [2, 3]]\>.

79 tests, 566 assertions, 1 failures, 0 errors
