示例#1
0
def test_gen_l3():
    str = 'hat'
    p = permutation_string.perm_rec(str)
    assert len(p) == 6
    assert p == ['hat', 'aht', 'ath', 'hta', 'tha', 'tah']

    p = permutation_string.perm_rec('aaa')
    assert len(p) == 6
    assert p == ['aaa', 'aaa', 'aaa', 'aaa', 'aaa', 'aaa']
示例#2
0
def test_gen_l5():
    str = 'haste'
    p = permutation_string.perm_rec(str)
    assert len(p) == 120
示例#3
0
def test_gen_l4():
    str = 'hats'
    p = permutation_string.perm_rec(str)
    assert len(p) == 24
示例#4
0
def test_gen_l1():
    str = 'o'
    p = permutation_string.perm_rec(str)

    assert len(p) == 1
    assert p == ['o']
示例#5
0
def test_gen_l2():
    str = 'ox'
    p = permutation_string.perm_rec(str)

    assert len(p) == 2
    assert p == ['ox', 'xo']