def test_permuteq(): assert results(permuteq((1, 2), (2, 1))) assert results(permuteq((1, 2, 2), (2, 1, 2))) assert not results(permuteq((1, 2), (2, 1, 2))) assert not results(permuteq((1, 2, 3), (2, 1, 2))) assert not results(permuteq((1, 2, 1), (2, 1, 2))) assert set(run(0, x, permuteq(x, (1, 2, 2)))) == set( ((1, 2, 2), (2, 1, 2), (2, 2, 1)))
def test_permuteq(): assert results(permuteq((1, 2), (2, 1))) assert results(permuteq((1, 2, 2), (2, 1, 2))) assert not results(permuteq((1, 2), (2, 1, 2))) assert not results(permuteq((1, 2, 3), (2, 1, 2))) assert not results(permuteq((1, 2, 1), (2, 1, 2))) assert set(run(0, x, permuteq(x, (1, 2, 2)))) == set(((1, 2, 2), (2, 1, 2), (2, 2, 1)))
def all_numbers(coll): return permuteq(coll, DIGITS)
def test(set): return permuteq(set, DIGITS)