Repository navigation
fix: a display line changing is not hidden by the other lines on the page - #68
Open
bluzername wants to merge 1 commit into
Open
bluzername wants to merge 1 commit into
bluzername wants to merge 1 commit into
Conversation
…page same_screen only looked at how many lines differ versus the page total. On a page with 10 or more lines, one line changing in any way was close enough to a clock or a ticker to count as no change, so a calculator display that gains a digit, or any other single-line content change, was swallowed when enough unrelated lines sat around it. Now a single line changed in place has to look like noise first (same text once a clock or a ticker is stripped, same length with at most one changed character, or a digit swap) before the ratio rule gets to decide. A real change no longer hides behind nine other lines that did not move. Added a test with a 10-line page where only the display line changes from "0" to "29": it failed before this fix (same_screen said True) and passes now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes part of #58 (bug 5, "One changed line in ten counts as the same screen").
same_screenonly looked at how many lines differ against the page total. On a page with 10 or more lines, any single line changing was close enough to the clock/ticker ratio rule to count as no change. So a calculator display that gains a digit, or any other one-line content change, was swallowed as long as enough unrelated lines sat around it. This is what let the Calculator run in #58 stall before reaching=.Fix: when exactly one line goes away and exactly one new line takes its place, that line is now checked for whether it looks like noise (same text once a clock/ticker is stripped, same length with at most one changed character, or a digit swap) before the ratio rule gets to decide. A real change no longer hides behind nine other lines that did not move. Noise (a clock, a ticker) is still absorbed exactly as before.
I re-derived this independently from the bug report rather than taking the diff there as-is; the shape ended up close to it, but the test is new.
Test: added
test_a_display_line_changing_is_a_new_screen_even_on_a_longer_pagetotests/test_signature.py- a 10-line page where only the display line changes from "0" to "29". It fails onmain(same_screenreturnsTrue, should beFalse) and passes with this fix.Ran before opening:
731 passed, 2 skipped, 1 xfailed (one more pass than
main's 730, the new test).🤖 Generated with Claude Code