about summary refs log tree commit diff stats
path: root/cpp/tangle/030tangle.test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/tangle/030tangle.test.cc')
-rw-r--r--cpp/tangle/030tangle.test.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/cpp/tangle/030tangle.test.cc b/cpp/tangle/030tangle.test.cc
index 3f86fdb8..bdf24a5c 100644
--- a/cpp/tangle/030tangle.test.cc
+++ b/cpp/tangle/030tangle.test.cc
@@ -196,6 +196,20 @@ void test_tangle_can_hide_warnings_in_scenarios() {
   CHECK(lines.empty());
 }
 
+void test_tangle_can_dump_traces_in_scenarios() {
+  istringstream in(":(scenario does_bar)\ndump foo\nabc def\n+layer1: pqr\n+layer2: xyz");
+  list<string> lines;
+  tangle(in, lines);
+  CHECK_EQ(lines.front(), "#line 1");  lines.pop_front();
+  CHECK_EQ(lines.front(), "#line 2");  lines.pop_front();
+  CHECK_EQ(lines.front(), "TEST(does_bar)");  lines.pop_front();
+  CHECK_EQ(lines.front(), "  Trace_stream->dump_layer = \"foo\";");  lines.pop_front();
+  CHECK_EQ(lines.front(), "  run(\"abc def\\n\");");  lines.pop_front();
+  CHECK_EQ(lines.front(), "  CHECK_TRACE_CONTENTS(\"layer1: pqrlayer2: xyz\");");  lines.pop_front();
+  CHECK_EQ(lines.front(), "}");  lines.pop_front();
+  CHECK(lines.empty());
+}
+
 void test_tangle_supports_strings_in_scenarios() {
   istringstream in(":(scenario does_bar)\nabc \"def\"\n+layer1: pqr\n+layer2: \"xyz\"");
   list<string> lines;