about summary refs log tree commit diff stats
path: root/cpp/002main.test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/002main.test.cc')
-rw-r--r--cpp/002main.test.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/cpp/002main.test.cc b/cpp/002main.test.cc
index 52db64bb..cc14762a 100644
--- a/cpp/002main.test.cc
+++ b/cpp/002main.test.cc
@@ -21,6 +21,21 @@ void test_parse() {
   CHECK_EQ(i->products[0].properties.size(), 0);
 }
 
+void test_parse_label() {
+  compile("recipe main [\n"
+          "  foo:\n"
+          "]\n");
+  cout << '\n'; DUMP("parse");
+  CHECK(Recipe_number.find("main") != Recipe_number.end());
+  recipe r = Recipe[Recipe_number["main"]];
+  vector<instruction>::iterator i = r.step.begin();
+  CHECK_EQ(i->is_label, true);
+  CHECK_EQ(i->label, string("foo"));
+  CHECK_EQ(i->operation, 0);
+  CHECK_EQ(i->ingredients.size(), 0);
+  CHECK_EQ(i->products.size(), 0);
+}
+
 void test_parse2() {
   compile("recipe main [\n"
           "  1:integer, 2:integer <- copy 23:literal\n"