def test_list_subtract_recover(xs, ys): missing = list_subtract(xs, ys) zs = list(ys) zs.extend([xs[i] for i in missing]) assert list(list_subtract(xs, zs)) == []
def test_list_subtract_same_list(xs): assert list(list_subtract(xs, xs)) == [] ys = list(xs) random.shuffle(ys) assert list(list_subtract(xs, ys)) == []