.... ---------------------------------------------------------------------- Ran 4 tests in 0.000s OK 'x y' $'one\ntwo\n' $'\'' '"' ## 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' Utf8Encode case 'e' 101 Utf8Encode case '\xc4\x80' 256 Utf8Encode case '\xe1\x88\xb4' 4660 Utf8Encode case '\xf0\xa0\x80\x80' 131072 Utf8Encode case '\xef\xbf\xbd' 268566528