notcurses icon indicating copy to clipboard operation
notcurses copied to clipboard

add unit test for input broken across ringbuffer boundary

Open dankamongmen opened this issue 3 years ago • 1 comments

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.

dankamongmen avatar Jul 11 '21 02:07 dankamongmen

hah, we ran into a real problem related to this: #2448

dankamongmen avatar Dec 12 '21 03:12 dankamongmen