. ---------------------------------------------------------------------- Ran 1 test in 0.000s OK ## shortest prefix 1 test 'a' return 'bcd' 2 test 'ab' return 'cd' 3 test 'abc' return 'd' 4 test 'abcd' return '' # longest prefix 4 test 'abcd' return '' 3 test 'abc' return 'd' 2 test 'ab' return 'cd' 1 test 'a' return 'bcd' % shortest suffix 3 test 'd' return 'abc' 2 test 'cd' return 'ab' 1 test 'bcd' return 'a' 0 test 'abcd' return '' %% longest suffix 0 test 'abcd' return '' 1 test 'bcd' return 'a' 2 test 'cd' return 'ab' 3 test 'd' return 'abc'