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 a test for Terminal#width #96

Closed
bitspittle opened this issue Mar 16, 2023 · 1 comment
Closed

Add a test for Terminal#width #96

bitspittle opened this issue Mar 16, 2023 · 1 comment
Labels
good first issue Good for newcomers process Backend work that needs to be done, likely not user visible

Comments

@bitspittle
Copy link
Contributor

See issue #95 which happened because I was lax about overriding the width value for native terminals.

At this point, I'm fairly confident width logic works right because I have so much existing code using this feature. But it would be really nice, still, to have a test for it.

Step 1) Allow passing the width value into TestTerminal
Step 2) Write a few tests to stress / verify long lines render / repaint as expected.

@bitspittle bitspittle added good first issue Good for newcomers process Backend work that needs to be done, likely not user visible labels Mar 16, 2023
@bitspittle
Copy link
Contributor Author

bitspittle commented Mar 17, 2023

Actually, this is nastier than I thought. To support this, you'd have to reimplement terminal virtual code handling in the test terminal (since it would need to know how long lines are, with control codes removed, so that it can append newlines at the right place). This would turn the intentionally simple and dumb TestTerminal class into something a bit more sophisticated.

This is doable but honestly probably not worth it. Going to close this out for now. A few users and I tested Terminal#width behavior across all the different platforms and it's working, so consider that an integration test :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers process Backend work that needs to be done, likely not user visible
Projects
None yet
Development

No branches or pull requests

1 participant