notcurses
notcurses copied to clipboard
add unit test for input broken across ringbuffer boundary
i'd like some assurance that we properly recognize UTF8 broken across the end of the ringbuffer. that ought be easy enough -- just find a sequence that doesn't evenly divideBUFSIZ
. Since BUFSIZ
is almost always a power of 2, and we know that no power of 2 is divided by 3, a 3-byte UTF8 character ought suffice. Pump (BUFSIZ + 3)/3 of them into input, and then loop through with notcurses_getc()
, and ensure they all come back.
hah, we ran into a real problem related to this: #2448