......... ---------------------------------------------------------------------- Ran 9 tests 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' EndsWithWhitespaceByteRange case (0, 0) '' EndsWithWhitespaceByteRange case (1, 1) 'x' EndsWithWhitespaceByteRange case (2, 2) ' x' EndsWithWhitespaceByteRange case (2, 3) ' x ' EndsWithWhitespaceByteRange case (2, 4) ' x \t' EndsWithWhitespaceByteRange case (0, 11) '\t\n\x0b\x0c\r \xc2\xa0\xef\xbb\xbf' NextUtf8Char case [1, 3, 6, 10] '$\xc2\xa2\xe0\xa4\xb9\xf0\x90\x8d\x88' NextUtf8Char case [1, 3, 'UTF-8 Error: Bad Encoding at byte index 3 in string of length 6'] '$\xc2\xa2\xe0\xe0\xa4' NextUtf8Char case [1, 3, 6, 'UTF-8 Error: Bad Encoding at byte index 6 in string of length 7'] '$\xc2\xa2\xe0\xa4\xa4\xb9' NextUtf8Char case [1, 3, 'UTF-8 Error: Bad Encoding at byte index 3 in string of length 4'] '$\xc2\xa2\xff' NextUtf8Char case [1, 'UTF-8 Error: Truncated Bytes at byte index 1 in string of length 4'] '$\xf0\x90\x8d' PreviousUtf8Char case [6, 3, 1, 0] '$\xc2\xa2\xe0\xa4\xb9\xf0\x90\x8d\x88' PreviousUtf8Char case [6, 3, 1, 'Invalid start of UTF-8 sequence'] '\xa2\xc2\xa2\xe0\xa4\xb9\xf0\x90\x8d\x88' PreviousUtf8Char case [10, 'Invalid start of UTF-8 sequence'] '\xf0\x90\x8d\x88\x90\x8d\x88\x90\x8d\x88$' PreviousUtf8Char case [3, 'Invalid start of UTF-8 sequence'] '\xf0\x90\x8d$' StartsWithWhitespaceByteRange case (0, 0) '' StartsWithWhitespaceByteRange case (0, 0) 'x' StartsWithWhitespaceByteRange case (0, 1) ' x' StartsWithWhitespaceByteRange case (0, 1) ' x ' StartsWithWhitespaceByteRange case (0, 2) '\t x ' StartsWithWhitespaceByteRange case (0, 11) '\t\n\x0b\x0c\r \xc2\xa0\xef\xbb\xbf'