def test_list_and_set(self): c = collect(list(range(10))).diff_seq(set(range(0, 5))) self.assertEqual(c.iterable, set(range(10)) - set(set(range(0, 5))))
def test_list(self): c = collect(list(range(10))) self.assertEqual(c.tuple(), tuple(range(10)))
def test_enumerate(self): c = collect(list(range(10))).enumerate() self.assertEqual(c.tuple(), tuple(enumerate(range(10))))
def test_dict_items(self): c = collect({'a': 1, 'b': 2}.items()) self.assertEqual(c.tuple(), tuple({'a': 1, 'b': 2}.items()))
def test_dict(self): c = collect({'a': 1, 'b': 2}) self.assertEqual(c.tuple(), tuple({'a': 1, 'b': 2}))
def test_iterator(self): c = collect(iter(range(10))) self.assertEqual(c.tuple(), tuple(range(10)))