about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-08-14 16:46:49 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-08-14 16:46:49 -0700
commitcc835be2510ecea40a2382014d2e943cddb4ec29 (patch)
tree2f41950ccf3fdffd030a34c56f871c25cee78efe
parent37dc6362f94de4ecf61c28bd5b5f34d6c949c2b9 (diff)
downloadmu-cc835be2510ecea40a2382014d2e943cddb4ec29.tar.gz
1993
Thanks Caleb Couch.
-rw-r--r--081run_interactive.cc5
-rw-r--r--edit.mu45
2 files changed, 49 insertions, 1 deletions
diff --git a/081run_interactive.cc b/081run_interactive.cc
index 6ef85afd..dfdc7bd6 100644
--- a/081run_interactive.cc
+++ b/081run_interactive.cc
@@ -286,7 +286,10 @@ case RELOAD: {
   }
   Hide_warnings = true;
   Disable_redefine_warnings = true;
-  load(read_mu_string(ingredients.at(0).at(0)));
+  vector<recipe_ordinal> recipes_reloaded = load(read_mu_string(ingredients.at(0).at(0)));
+  for (long long int i = 0; i < SIZE(recipes_reloaded); ++i) {
+    Name.erase(recipes_reloaded.at(i));
+  }
   transform_all();
   Trace_stream->newline();  // flush trace
   Disable_redefine_warnings = false;
diff --git a/edit.mu b/edit.mu
index 5c3dfee5..b34a8389 100644
--- a/edit.mu
+++ b/edit.mu
@@ -5663,6 +5663,51 @@ recipe foo [
   ]
 ]
 
+scenario run-shows-warnings-everytime [
+  $close-trace
+  # try to run a file with an error
+  assume-screen 100/width, 15/height
+  assume-console [
+    press 65532  # F4
+  ]
+  run [
+    1:address:array:character <- new [ 
+recipe foo [
+  x:number <- copy y:number
+]]
+    2:address:array:character <- new [foo]
+    3:address:programming-environment-data <- new-programming-environment screen:address, 1:address:array:character, 2:address:array:character
+    event-loop screen:address, console:address, 3:address:programming-environment-data
+  ]
+  screen-should-contain [
+    .                                                                                 run (F4)           .
+    .                                                  ┊foo                                              .
+    .recipe foo [                                      ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
+    .  x:number <- copy y:number                       ┊                                                 .
+    .]                                                 ┊                                                 .
+    .use before set: y in foo                          ┊                                                 .
+    .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊                                                 .
+    .                                                  ┊                                                 .
+  ]
+  # rerun the file, check for the same error
+  assume-console [
+    press 65532  # F4
+  ]
+  run [
+    event-loop screen:address, console:address, 3:address:programming-environment-data
+  ]
+  screen-should-contain [
+    .                                                                                 run (F4)           .
+    .                                                  ┊foo                                              .
+    .recipe foo [                                      ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
+    .  x:number <- copy y:number                       ┊                                                 .
+    .]                                                 ┊                                                 .
+    .use before set: y in foo                          ┊                                                 .
+    .┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┊                                                 .
+    .                                                  ┊                                                 .
+  ]
+]
+
 ## helpers for drawing editor borders
 
 recipe draw-box [