-
-
Notifications
You must be signed in to change notification settings - Fork 367
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
fix(TestBackend): prevent area mismatch #1252
Conversation
`TestBackend::new(400, 400)` resulted in a Rect with width/height 255,255 and a locally stored width/height of 400,400 which is wrong. `TestBackend::new` could have been fixed but this prevents this kind of error completely as its stored only at a single location now.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1252 +/- ##
=======================================
- Coverage 94.6% 94.6% -0.1%
=======================================
Files 65 65
Lines 15407 15402 -5
=======================================
- Hits 14576 14571 -5
Misses 831 831 ☔ View full report in Codecov by Sentry. |
Is this a breaking change? TestBackend implements serde derive. Reading from an older version should still work but reading from a newer version will not. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with generally breaking forwards compatibility without noting it as a breaking change in the conventional commit / BREAKING-CHANGES doc. Just make sure the commit (PR comment) calls it out so it gets called out in the changelog.
Ping @a-kenji for their thoughts on this, as the reason TestBackend supports serde is for the reasons mentioned is for an external testing lib mentioned in #389. I'm assuming that it's probably ok though, and if kenji doesn't have time to weigh on this, then we can go ahead and merge this as-is.
Bencher
Click to view all benchmark results
Bencher - Continuous Benchmarking View Public Perf Page Docs | Repo | Chat | Help |
Removes the height and width fields from TestBackend, which can get out of sync with the Buffer, which currently clamps to 255,255. This changes the `TestBackend` serde representation. It should be possible to read older data, but data generated after this change can't be read by older versions.
TestBackend::new(400, 400)
resulted in a Rect with width/height 255,255 and a locally stored width/height of 400,400 which is wrong.TestBackend::new
could have been fixed, but this prevents this kind of error completely as its stored only at a single location now.Hint for
serde
feature users: TheTestBackend
representation changes. It should be able to read older data, but data generated after this change can't be read by older versions.