-
Notifications
You must be signed in to change notification settings - Fork 1.5k
BUG: Avoid accessing invalid page when inserting blank page under some conditions #3529
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
base: main
Are you sure you want to change the base?
Conversation
width and height are now treated symmetrically, and updated only if they are not provided.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3529 +/- ##
=======================================
Coverage 97.16% 97.16%
=======================================
Files 57 57
Lines 9807 9811 +4
Branches 1780 1782 +2
=======================================
+ Hits 9529 9533 +4
Misses 167 167
Partials 111 111 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
stefan6419846
left a comment
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.
- Please add a test for an out-of-bounds index.
- What happens if the width is 0 or negative?
- Please update the title to reflect what the actual bug was - currently, it is not obvious which logic is meant or what was wrong.
If |
|
The specific case from #3337 (comment) is still not tested? |
|
Shall I do this? |
Add a test for an out-of-bounds index does this I thought. Have I not done the test correctly? |
|
If would use
Have you tested the behavior without your change to the logic? Did it fail? If not, your change most likely does not yet cover the desired case. |
No. So I do the same check on the old code and make sure it fails? |
|
Yes. This is the usual way you should assert that your tests are correct. |
Thanks.
Will do. Is this the only outstanding now? |
As far as I can currently see, yes. We probably want to cover both variants (setting only width, setting only height), although only one case has previously been broken, but it makes the tests more consistent. |
|
The old code: Has this error: Because the |
width and height are now treated symmetrically and updated only if they are not provided.