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 tests for subplane scrolling #1951

Closed
dankamongmen opened this issue Jul 18, 2021 · 5 comments
Closed

add unit tests for subplane scrolling #1951

dankamongmen opened this issue Jul 18, 2021 · 5 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@dankamongmen
Copy link
Owner

We supposedly worked out subplane scrolling in #1883, but the evidence (a working notcurses-info no matter the launch point) was resolved by an entirely different technique. So I have my doubts. Let's add some unit tests for this. Ideally, I think we'd move display_bitmap() in notcurses_info back to where it was, and exercise the subplane scrolling code.

@dankamongmen dankamongmen added the enhancement New feature or request label Jul 18, 2021
@dankamongmen dankamongmen added this to the 3.0.0 milestone Jul 18, 2021
@dankamongmen dankamongmen self-assigned this Jul 18, 2021
@dankamongmen
Copy link
Owner Author

I've written a unit test for both cases, and it's supposedly passing, but visual inspection suggests something to be off. I think we're still scrolling despite NCPLANE_OPTION_FIXED -- we don't reflect it in our position, but we're scrolled, and we don't redraw in the old location.

@dankamongmen
Copy link
Owner Author

and in the normal scrolling case, the subplane scrolls up as expected (6 lines), but the rest only scrolls up 3 (we would expect 6 here, as well). what?

@dankamongmen
Copy link
Owner Author

i've whipped up a PoC around this, cli. definitely seeing some problems. the fixed subplane is disappearing when we scroll the standard plane up...very odd...

@dankamongmen
Copy link
Owner Author

 -------------------------- notcurses debug state -----------------------------                                           
  *************************   0x55b19da53a60 pile ****************************                                            
0000 off y:  67 x:  20 geom y:   2 x:  10 curs y:   0 x:   0 0x55b19da700d0 
 bound 0x55b19da53980 ← 0x55b19da539f0 → 0x55b19da6fea0 binds (nil)
0001 off y:  67 x:   2 geom y:   2 x:  10 curs y:   0 x:   0 0x55b19da6fea0 
 bound 0x55b19da53980 ← 0x55b19da70130 → (nil) binds (nil)
0002 off y:   0 x:   0 geom y:  70 x: 122 curs y:  69 x: 122 0x55b19da53980 std
 bound 0x55b19da53980 ← 0x55b19da53a70 → (nil) binds 0x55b19da700d0
 ______________________________________________________________________________
 -------------------------- notcurses debug state -----------------------------
  *************************   0x55b19da53a60 pile ****************************
0000 off y:  67 x:  20 geom y:   2 x:  10 curs y:   0 x:   0 0x55b19da700d0 
 bound 0x55b19da53980 ← 0x55b19da539f0 → 0x55b19da6fea0 binds (nil)
0001 off y:  66 x:   2 geom y:   2 x:  10 curs y:   0 x:   0 0x55b19da6fea0 
 bound 0x55b19da53980 ← 0x55b19da70130 → (nil) binds (nil)
0002 off y:   0 x:   0 geom y:  70 x: 122 curs y:  69 x:   0 0x55b19da53980 std
 bound 0x55b19da53980 ← 0x55b19da53a70 → (nil) binds 0x55b19da700d0
 ______________________________________________________________________________
 -------------------------- notcurses debug state -----------------------------
  *************************   0x55b19da53a60 pile ****************************
0000 off y:  67 x:  20 geom y:   2 x:  10 curs y:   0 x:   0 0x55b19da700d0 
 bound 0x55b19da53980 ← 0x55b19da539f0 → 0x55b19da6fea0 binds (nil)
0001 off y:  65 x:   2 geom y:   2 x:  10 curs y:   0 x:   0 0x55b19da6fea0 
 bound 0x55b19da53980 ← 0x55b19da70130 → (nil) binds (nil)
0002 off y:   0 x:   0 geom y:  70 x: 122 curs y:  69 x:   0 0x55b19da53980 std
 bound 0x55b19da53980 ← 0x55b19da53a70 → (nil) binds 0x55b19da700d0
 ______________________________________________________________________________
 -------------------------- notcurses debug state -----------------------------
  *************************   0x55b19da53a60 pile ****************************
0000 off y:  67 x:  20 geom y:   2 x:  10 curs y:   0 x:   0 0x55b19da700d0 
 bound 0x55b19da53980 ← 0x55b19da539f0 → 0x55b19da6fea0 binds (nil)
0001 off y:  64 x:   2 geom y:   2 x:  10 curs y:   0 x:   0 0x55b19da6fea0 
 bound 0x55b19da53980 ← 0x55b19da70130 → (nil) binds (nil)
0002 off y:   0 x:   0 geom y:  70 x: 122 curs y:  69 x:   0 0x55b19da53980 std
 bound 0x55b19da53980 ← 0x55b19da53a70 → (nil) binds 0x55b19da700d0
 ______________________________________________________________________________
 -------------------------- notcurses debug state -----------------------------
  *************************   0x55b19da53a60 pile ****************************
0000 off y:  67 x:  20 geom y:   2 x:  10 curs y:   0 x:   0 0x55b19da700d0 
 bound 0x55b19da53980 ← 0x55b19da539f0 → 0x55b19da6fea0 binds (nil)
0001 off y:  63 x:   2 geom y:   2 x:  10 curs y:   0 x:   0 0x55b19da6fea0 
 bound 0x55b19da53980 ← 0x55b19da70130 → (nil) binds (nil)
0002 off y:   0 x:   0 geom y:  70 x: 122 curs y:  69 x:   0 0x55b19da53980 std
 bound 0x55b19da53980 ← 0x55b19da53a70 → (nil) binds 0x55b19da700d0
 ______________________________________________________________________________
 -------------------------- notcurses debug state -----------------------------
  *************************   0x55b19da53a60 pile ****************************
0000 off y:  67 x:  20 geom y:   2 x:  10 curs y:   0 x:   0 0x55b19da700d0 
 bound 0x55b19da53980 ← 0x55b19da539f0 → 0x55b19da6fea0 binds (nil)
0001 off y:  62 x:   2 geom y:   2 x:  10 curs y:   0 x:   0 0x55b19da6fea0 
 bound 0x55b19da53980 ← 0x55b19da70130 → (nil) binds (nil)
0002 off y:   0 x:   0 geom y:  70 x: 122 curs y:  69 x:   0 0x55b19da53980 std
 bound 0x55b19da53980 ← 0x55b19da53a70 → (nil) binds 0x55b19da700d0
 ______________________________________________________________________________

so according to internal state, the FIXED one ought be staying where it is, at line 67, whereas the nonFIXED one ought indeed be rising -- as we see happen.

so what does this mean? it suggests to me that our internal logic is correct, but it's not being properly executed. when we scroll, we scroll everything visible up, which is good for things which ought have scrolled, but wrong for things which ought not have scrolled. pretty simple. that explains the weirdness we saw in the second unit test i added, though not the first. it also means testing for this will be difficult, since all internal logic shows the correct values, and the error is only visible on-screen, ugh.

so...we've got our unit tests. and we now know what's up with this issue. let's create a new bug for it.

@dankamongmen
Copy link
Owner Author

the mysterious stepping has gone away with 3cb54de, which seems to have addressed all of these problems, pretty much. yay!

@dankamongmen dankamongmen modified the milestones: 3.0.0, 2.4.0 Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant