コード例 #1
0
ファイル: chainz_test.py プロジェクト: jagill/python-chainz
    def test_copy_after_map(self):
        a = Chain(range(3)).map(lambda x: 2 * x)
        b = a.copy()
        a.map(lambda x: 3 * x)

        self.assertEqual(list(a), [0, 6, 12])
        self.assertEqual(list(b), [0, 2, 4])
コード例 #2
0
ファイル: chainz_test.py プロジェクト: jagill/python-chainz
    def test_copy(self):
        a = Chain(range(3))
        b = a.copy()
        a.map(lambda x: 2 * x)

        self.assertEqual(list(a), [0, 2, 4])
        self.assertEqual(list(b), [0, 1, 2])