Beispiel #1
0
def test_all_permutations():
    obs = {"".join(p) for p in all_permutations("ABC")}
    exp = {
        "A",
        "B",
        "C",
        "AB",
        "AC",
        "BA",
        "BC",
        "CA",
        "CB",
        "ACB",
        "CBA",
        "BAC",
        "CAB",
        "BCA",
        "ABC",
    }
    assert obs == exp
Beispiel #2
0
def test_all_permutations():
    obs = {"".join(p) for p in all_permutations("ABC")}
    exp = {
        "A",
        "B",
        "C",
        "AB",
        "AC",
        "BA",
        "BC",
        "CA",
        "CB",
        "ACB",
        "CBA",
        "BAC",
        "CAB",
        "BCA",
        "ABC",
    }
    assert obs == exp