Beispiel #1
0
 def test_delete_2(self):
     a = [0, 1, 2, 3, 4, 5]
     fn = zz.delete(zz.var(a)[_1])
     fn(0)
     self.assertEqual(a, [1, 2, 3, 4, 5])
     fn(3)
     self.assertEqual(a, [1, 2, 3, 5])
Beispiel #2
0
 def test_delete_1(self):
     a = [0, 1, 2]
     fn = zz.delete(zz.var(a)[0])
     fn()
     self.assertEqual(a, [1, 2])
     fn()
     self.assertEqual(a, [2])
     fn()
     self.assertEqual(a, [])
     with self.assertRaises(IndexError):
         fn()