def testMergeOne(self): assert(merge(['ab', 'bc']) == ['abc'])
def testEmpty(self): assert(merge([]) == [])
def testSanity(self): assert(arePathsSane(['abc', 'xy'])) assert(not arePathsSane(['abc', 'bd'])) assert(not arePathsSane(['abc', 'cd'])) assert(arePathsSane(merge(['ab', 'bc', 'cd', 'xy'])))
def testJoinPaths(self): res = merge(['mn', 'op', 'no', 'xy']) res.sort() assert (res == ['mnop', 'xy'])
def testBackwards(self): res = merge(['cd', 'bc', 'ab', 'xy']) res.sort() assert(res == ['abcd', 'xy'])
def testMergeTwo(self): res = merge(['ab', 'bc', 'cd', 'xy']) res.sort() assert(res == ['abcd', 'xy'])