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
def test__word_ladder_2(): assert not _adjacent('stone', 'stone1')
def test__word_ladder_1(): assert not _adjacent('stone', 'money')
def test__word_ladder_5(): assert _adjacent('stone', 'shone')
def test__word_ladder_4(): assert _adjacent('stone', 'stony')
def test__word_ladder_1b(): assert not _adjacent('money', 'stone')
def test__word_ladder_7b(): assert not _adjacent('shone', '')
def test__word_ladder_7(): assert not _adjacent('', 'shone')