Exemple #1
0
def test__word_ladder_fuzz():
    with open('words5.dict') as f:
        words = f.readlines()
        words = list(set([word.strip() for word in words]))
    for i in range(1000000):
        word1 = random.choice(words)
        word2 = random.choice(words)
        res1 = _adjacent(word1, word2)
        res2 = _adjacent(word2, word1)
        assert res1 == res2 or res1 is res2
Exemple #2
0
def test__word_ladder_2():
    assert not _adjacent('stone', 'stone1')
Exemple #3
0
def test__word_ladder_1():
    assert not _adjacent('stone', 'money')
Exemple #4
0
def test__word_ladder_5():
    assert _adjacent('stone', 'shone')
Exemple #5
0
def test__word_ladder_4():
    assert _adjacent('stone', 'stony')
Exemple #6
0
def test__word_ladder_1b():
    assert not _adjacent('money', 'stone')
Exemple #7
0
def test__word_ladder_7b():
    assert not _adjacent('shone', '')
Exemple #8
0
def test__word_ladder_7():
    assert not _adjacent('', 'shone')