コード例 #1
0
ファイル: list_ops_test.py プロジェクト: riseshia/exercism
 def test_filter_even(self):
     self.assertEqual((2, 4, 6),
                      tuple(
                          list_ops.filter_clone(lambda x: x % 2 == 0,
                                                [1, 2, 3, 4, 5, 6])))
コード例 #2
0
ファイル: list_ops_test.py プロジェクト: thedubb/python-1
 def test_filter_nonempty_list(self):
     self.assertEqual(
         list_ops.filter_clone(lambda x: x % 2 == 1, [1, 2, 3, 4, 5]),
         [1, 3, 5])
コード例 #3
0
ファイル: list_ops_test.py プロジェクト: riseshia/exercism
 def test_filter_odd(self):
     self.assertEqual((1, 3, 5),
                      tuple(
                          list_ops.filter_clone(lambda x: x % 2 != 0,
                                                [1, 2, 3, 4, 5, 6])))
コード例 #4
0
ファイル: list_ops_test.py プロジェクト: thedubb/python-1
 def test_filter_empty_list(self):
     self.assertEqual(list_ops.filter_clone(lambda x: x % 2 == 1, []), [])
コード例 #5
0
 def test_filter_nonempty_list(self):
     self.assertEqual(
         list_ops.filter_clone(lambda x: x % 2 == 1, [1, 2, 3, 4, 5]),
         [1, 3, 5])
コード例 #6
0
 def test_filter_empty_list(self):
     self.assertEqual(list_ops.filter_clone(lambda x: x % 2 == 1, []), [])
コード例 #7
0
ファイル: list_ops_test.py プロジェクト: a62mds/exercism
 def test_filter_even(self):
     self.assertEqual(
         (2, 4, 6),
         tuple(list_ops.filter_clone(lambda x: x % 2 == 0, [1, 2, 3, 4, 5, 6]))
     )
コード例 #8
0
ファイル: list_ops_test.py プロジェクト: a62mds/exercism
 def test_filter_odd(self):
     self.assertEqual(
         (1, 3, 5),
         tuple(list_ops.filter_clone(lambda x: x % 2 != 0, [1, 2, 3, 4, 5, 6]))
     )