about summary refs log tree commit diff stats
path: root/cpp/011load
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-04-08 00:13:11 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-04-08 00:15:26 -0700
commit26785f2a7c2937765f1c0c9e26ce6b80aa4f8dfe (patch)
tree86bf3ba3ef9c54f664515aa008d6bc32e96449bc /cpp/011load
parent9ea7648336251d440a9cd8d91112254e8b38268c (diff)
downloadmu-26785f2a7c2937765f1c0c9e26ce6b80aa4f8dfe.tar.gz
1031 - stop clearing recipes after every test
I think the string-equal scenarios are failing to fail. But we'll fix
them once we wrap up test isolation.
Diffstat (limited to 'cpp/011load')
-rw-r--r--cpp/011load7
1 files changed, 6 insertions, 1 deletions
diff --git a/cpp/011load b/cpp/011load
index 5657486b..28f63521 100644
--- a/cpp/011load
+++ b/cpp/011load
@@ -24,6 +24,7 @@ vector<recipe_number> add_recipes(istream& in) {
     // Command Handlers
     if (command == "recipe") {
       result.push_back(add_recipe(in));
+      recipes_added_by_test.push_back(result.back());
     }
     // End Command Handlers
     else {
@@ -36,7 +37,7 @@ vector<recipe_number> add_recipes(istream& in) {
 recipe_number add_recipe(istream& in) {
   skip_comments_and_newlines(in);
   string recipe_name = next_word(in);
-//?   cout << "recipe name: ^" << recipe_name << "$\n"; //? 2
+//?   cout << "recipe name: ^" << recipe_name << "$\n"; //? 3
   if (recipe_name.empty())
     raise << "empty recipe name\n";
 //?     raise << "empty recipe name in " << in.str() << '\n';
@@ -45,6 +46,10 @@ recipe_number add_recipe(istream& in) {
 //?     cout << "AAA: " << recipe_name << " is now " << Recipe_number[recipe_name] << '\n'; //? 1
   }
   recipe_number r = Recipe_number[recipe_name];
+  if (Recipe.find(r) != Recipe.end()) {
+    raise << "redefining recipe " << Recipe[r].name << "\n";
+    Recipe.erase(r);
+  }
 //?   cout << recipe_name << ": adding recipe " << r << '\n'; //? 3
 
   skip_whitespace(in);