diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2017-06-23 23:06:21 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2017-06-23 23:06:21 -0700 |
commit | bb97f580fb1c769ba0cc362d1c751e69377050a8 (patch) | |
tree | 1221dc9faa32f57ca9e60546e7e10eb837609b7d | |
parent | 54edd3d25e990cdf6ead2f0cdf685bc23de85edf (diff) | |
download | mu-bb97f580fb1c769ba0cc362d1c751e69377050a8.tar.gz |
3944
Reintroduce the failing test of commit 3938. It has two problems: a) it's failing, and b) it's not failing the same way as with a real screen.
-rw-r--r-- | edit/005-sandbox.mu | 26 | ||||
-rw-r--r-- | sandbox/005-sandbox.mu | 26 |
2 files changed, 50 insertions, 2 deletions
diff --git a/edit/005-sandbox.mu b/edit/005-sandbox.mu index 9970bbae..4b3a3881 100644 --- a/edit/005-sandbox.mu +++ b/edit/005-sandbox.mu @@ -267,7 +267,7 @@ def! render-sandbox-side screen:&:screen, env:&:environment, render-editor:rende row, screen <- render-sandboxes screen, sandbox, left, right, row, render-from clear-rest-of-screen screen, row, left, right # - assert-no-scroll screen, old-top-idx +#? assert-no-scroll screen, old-top-idx ] def render-sandboxes screen:&:screen, sandbox:&:sandbox, left:num, right:num, row:num, render-from:num, idx:num -> row:num, screen:&:screen, sandbox:&:sandbox [ @@ -343,6 +343,30 @@ def render-sandbox-menu screen:&:screen, sandbox-index:num, left:num, right:num clear-line-until screen, right, 52/background-red ] +scenario skip-rendering-sandbox-menu-past-bottom-row [ + trace-until 100/app # trace too long + assume-screen 100/width, 6/height + # recipe editor is empty + assume-resources [ + [lesson/0] <- [|add 2, 2|] + [lesson/1] <- [|add 1, 1|] + ] + # create two sandboxes such that the top one just barely fills the screen + env:&:environment <- new-programming-environment resources, screen, [] + env <- restore-sandboxes env, resources + run [ + render-all screen, env, render + ] + screen-should-contain [ + . run (F4) . + . ┊ . + .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊─────────────────────────────────────────────────. + . ┊0 edit copy to recipe delete . + . ┊add 2, 2 . + . ┊─────────────────────────────────────────────────. + ] +] + # divide up the menu bar for a sandbox into 3 segments, for edit/copy/delete buttons # delete-button-right == right # all left/right pairs are inclusive diff --git a/sandbox/005-sandbox.mu b/sandbox/005-sandbox.mu index cc7892d6..2b671a07 100644 --- a/sandbox/005-sandbox.mu +++ b/sandbox/005-sandbox.mu @@ -251,7 +251,7 @@ def! render-sandbox-side screen:&:screen, env:&:environment, render-editor:rende row, screen <- render-sandboxes screen, sandbox, left, right, row, render-from, 0, env clear-rest-of-screen screen, row, left, right # - assert-no-scroll screen, old-top-idx +#? assert-no-scroll screen, old-top-idx ] def render-sandboxes screen:&:screen, sandbox:&:sandbox, left:num, right:num, row:num, render-from:num, idx:num -> row:num, screen:&:screen, sandbox:&:sandbox [ @@ -326,6 +326,30 @@ def render-sandbox-menu screen:&:screen, sandbox-index:num, left:num, right:num clear-line-until screen, right, 52/background-red ] +scenario skip-rendering-sandbox-menu-past-bottom-row [ + trace-until 100/app # trace too long + assume-screen 50/width, 6/height + # recipes.mu is empty + assume-resources [ + [lesson/0] <- [|add 2, 2|] + [lesson/1] <- [|add 1, 1|] + ] + # create two sandboxes such that the top one just barely fills the screen + env:&:environment <- new-programming-environment resources, screen, [] + env <- restore-sandboxes env, resources + run [ + render-all screen, env, render + ] + screen-should-contain [ + . run (F4) . + . . + .──────────────────────────────────────────────────. + .0 edit copy delete . + .add 2, 2 . + .──────────────────────────────────────────────────. + ] +] + # divide up the menu bar for a sandbox into 3 segments, for edit/copy/delete buttons # delete-button-right == right # all left/right pairs are inclusive |