terminal/src/til
Steffen b8e33560f9
make sure caching of partials still works if the string consists of a single lead byte only (GH#4673) (#4685)
## Summary of the Pull Request
Fixes a flaw that happened if `til::u8u16` received a single lead byte.

## PR Checklist
* [x] Closes #4673 
* [x] Tests added/passed

## Detailed Description of the Pull Request / Additional comments
The loop for caching partials didn't run and thus, the lead byte was
converted to U+FFFD. That's because the loop starts with `sequenceLen`
initialized with 1. And if the string has a length of 1 the initial
condition is `1<1` which is evaluated to `false` and the body of the
loop was never executed.

## Validation Steps Performed
1) updated the code of the state class and tested manually that `printf
   "\xE2"; printf "\x98\xBA\n"` prints a U+263A character
2) updated the unit tests to make sure that still up to 3 partials are
   cached
3) updated the unit tests to make sure caching also works if the string
   consists of a lead byte only
4) tested manually that #4086 is still resolved
2020-02-21 20:45:53 +00:00
..
ut_til make sure caching of partials still works if the string consists of a single lead byte only (GH#4673) (#4685) 2020-02-21 20:45:53 +00:00
dirs Introduce til::some (#4123) 2020-01-09 09:07:52 -08:00
precomp.cpp Introduce til::some (#4123) 2020-01-09 09:07:52 -08:00
precomp.h Introduce til::some (#4123) 2020-01-09 09:07:52 -08:00