Esempio n. 1
0
 def test_map(self):
     func = lambda x, y, z: x + y + z
     lst = [builtins.range(10), builtins.range(10), builtins.range(10)]
     actual1 = map(func, *lst)
     actual2 = lmap(func, *lst)
     actual = [actual1, actual2],
     expected = list(builtins.map(func, *lst)),
     lengths = 10,
     self.check_result(actual, expected, lengths)
Esempio n. 2
0
    def test_range(self):
        actual1 = range(10)
        actual2 = lrange(10)
        actual = [actual1, actual2],
        expected = list(builtins.range(10)),
        lengths = 10,

        actual1 = range(1, 10, 2)
        actual2 = lrange(1, 10, 2)
        actual += [actual1, actual2],
        lengths += 5,
        expected += list(builtins.range(1, 10, 2)),
        self.check_result(actual, expected, lengths)
Esempio n. 3
0
    def test_range(self):
        actual1 = range(10)
        actual2 = lrange(10)
        actual = ([actual1, actual2],)
        expected = (list(builtins.range(10)),)
        lengths = (10,)

        actual1 = range(1, 10, 2)
        actual2 = lrange(1, 10, 2)
        actual += ([actual1, actual2],)
        lengths += (5,)
        expected += (list(builtins.range(1, 10, 2)),)
        self.check_result(actual, expected, lengths)
Esempio n. 4
0
 def test_filter(self):
     func = lambda x: x
     lst = list(builtins.range(10))
     actual1 = filter(func, lst)
     actual2 = lfilter(func, lst)
     actual = [actual1, actual2],
     lengths = 9,
     expected = list(builtins.filter(func, lst)),
     self.check_result(actual, expected, lengths)
Esempio n. 5
0
 def test_zip(self):
     lst = [builtins.range(10), builtins.range(10), builtins.range(10)]
     actual = [zip(*lst), lzip(*lst)],
     expected = list(builtins.zip(*lst)),
     lengths = 10,
     self.check_result(actual, expected, lengths)