示例#1
0
 def test_doubleton(self):
     self.assertEqual([[1, 2], [2, 1]], list(generate_permutations([1, 2])))
示例#2
0
 def test_triple(self):
     self.assertEqual(
         [[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]],
         list(generate_permutations([1, 2, 3])))
示例#3
0
 def test_singleton(self):
     self.assertEqual([[1]], list(generate_permutations([1])))