about summary refs log tree commit diff stats
path: root/edit
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-08-25 02:02:56 -0700
committerKartik K. Agaram <vc@akkartik.com>2017-08-25 02:02:56 -0700
commit0899b237b0923a07ecac16a9adf551921925c5a3 (patch)
tree99bf9786315a6f6d88fed38b6473b99445721adb /edit
parent8a92572df505eab170912e082e085301e7fecddd (diff)
downloadmu-0899b237b0923a07ecac16a9adf551921925c5a3.tar.gz
3984 - bugfix: display errors when scrolling recipe side
This regression was (also) introduced by commit 3902 in June.
Diffstat (limited to 'edit')
-rw-r--r--edit/011-errors.mu38
1 files changed, 38 insertions, 0 deletions
diff --git a/edit/011-errors.mu b/edit/011-errors.mu
index 8db2c583..554130b5 100644
--- a/edit/011-errors.mu
+++ b/edit/011-errors.mu
@@ -35,6 +35,10 @@ before <end-run-sandboxes-on-F4> [
   screen <- render-recipe-errors env, screen
 ]
 
+before <end-render-recipe-components> [
+  screen <- render-recipe-errors env, screen
+]
+
 def render-recipe-errors env:&:environment, screen:&:screen -> screen:&:screen [
   local-scope
   load-ingredients
@@ -621,6 +625,40 @@ scenario run-hides-errors [
   ]
 ]
 
+scenario scrolling-recipe-side-reveals-errors [
+  local-scope
+  trace-until 100/app  # trace too long
+  assume-screen 100/width, 5/height
+  # recipe overflows recipe side
+  assume-resources [
+    [lesson/recipes.mu] <- [
+      |recipe foo [|
+      |  a:num <- copy 0|  # padding to overflow recipe side
+      |  b:num <- copy 0|  # padding to overflow recipe side
+      |  get 123:num, foo:offset|  # line containing error
+      |]|
+    ]
+  ]
+  env:&:environment <- new-programming-environment resources, screen, [foo]
+  render-all screen, env, render
+  # hit F4, generating errors, then scroll down
+  assume-console [
+    press F4
+    press page-down
+  ]
+  run [
+    event-loop screen, console, env, resources
+  ]
+  # errors should be displayed
+  screen-should-contain [
+    .  errors found                                                                   run (F4)           .
+    .  get 123:num, foo:offset                         ┊foo                                              .
+    .\\]                                                 ┊─────────────────────────────────────────────────.
+    .foo: unknown element 'foo' in container 'number'  ┊                                                 .
+    .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊                                                 .
+  ]
+]
+
 scenario run-instruction-and-print-errors [
   local-scope
   trace-until 100/app  # trace too long