From 35f9c4276cbcedbbcd5a7ffb6f4fbad4029f5f96 Mon Sep 17 00:00:00 2001 From: Ingo Karkat Date: Fri, 13 Apr 2012 16:54:40 +0200 Subject: [PATCH] test-lib: Allow expected output with empty lines. An empty line is used to delimit test commands in test_todo_session. (This wasn't properly reflected in the usage comment, fixed that, too.) This prevents us from testing commands that include empty lines. (Currently, there is no such output in todo.sh, but custom add-ons may have this.) Instead of forcing the test to filter out the empty lines, extend the syntax to allow empty lines in the expected output by escaping them with a single backslash. (When redirecting via <>> command # output1 # output2 +# # >>> command # === exit status -# output3 -# output4 +# output3 with empty line (must be escaped here) +# \ +# output5 # EOF test_todo_session () { test "$#" = 1 || @@ -606,6 +608,9 @@ test_todo_session () { > expect fi ;; + \\) + echo "" >> expect + ;; *) echo "$line" >> expect ;;