def test_complete(self): xform = xf.comp(xf.filter_indexed(self.even_i_pos_v), xf.partition_all(2)) self.assertEqual(list(xf.xiter(xform, [-1, 2, 3, 4, 5, 6, 7])), [(3, 5), (7,)])
def test_arity_zero(self): self.assertEqual(xf.filter_indexed(None)(lambda: 'success')(), 'success')
def test_empty(self): xform = xf.filter_indexed(lambda i, v: True) self.assertEqual(list(xf.xiter(xform, [])), [])
def test_reduced(self): xform = xf.comp(xf.filter_indexed(self.even_i_pos_v), xf.take(1)) self.assertEqual(list(xf.xiter(xform, [-1, 2, 3, 4, 5])), [3])
def test_not_empty(self): xform = xf.filter_indexed(self.even_i_pos_v) self.assertEqual(list(xf.xiter(xform, [-1, 2, 3, 4, 5])), [3, 5])