Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add unit test for input broken across ringbuffer boundary #1916

Open
dankamongmen opened this issue Jul 11, 2021 · 1 comment
Open

add unit test for input broken across ringbuffer boundary #1916

dankamongmen opened this issue Jul 11, 2021 · 1 comment
Labels
enhancement New feature or request hax0rs-wanted looking to hack on notcurses? try these input readin' dem bytes

Comments

@dankamongmen
Copy link
Owner

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 dankamongmen added enhancement New feature or request hax0rs-wanted looking to hack on notcurses? try these labels Jul 11, 2021
@dankamongmen dankamongmen added this to the 3.0.0 milestone Jul 11, 2021
@dankamongmen dankamongmen added the input readin' dem bytes label Sep 23, 2021
@dankamongmen dankamongmen removed this from the 3.0.0 milestone Oct 3, 2021
@dankamongmen
Copy link
Owner Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hax0rs-wanted looking to hack on notcurses? try these input readin' dem bytes
Projects
None yet
Development

No branches or pull requests

1 participant