Permalink
Browse files

extend Array#permutations: test

  • Loading branch information...
bakkdoor committed Nov 15, 2013
1 parent af2a438 commit 27583ce4f0464cb4db65de9ab9a8fd1a2cd24069
Showing with 9 additions and 5 deletions.
  1. +9 −5 tests/array.fy
@@ -572,11 +572,15 @@ FancySpec describe: Array with: {
}
it: "returns an array of permutations of self" with: 'permutations: when: {
[] permutations to_a is: [[]]
[] permutations: 0 . to_a is: [[]]
[1] permutations to_a is: [[1]]
[1,2] permutations to_a is: [[1,2], [2,1]]
[1,2,3] permutations to_a is: \
[] permutations to_a is: [[]]
[] permutations: 0 . to_a is: [[]]
[1] permutations to_a is: [[1]]
[1,2] permutations to_a is: [[1,2], [2,1]]
[1,2,3] permutations: 2 . to_a is: \
[[1, 2], [1, 3], [2, 1], [2, 3], [3, 1], [3, 2]]
[1,2,3] permutations to_a is: \
[[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]
}
}

0 comments on commit 27583ce

Please sign in to comment.