From 32530f0e50ba5cd4e3259f8f1868e28ae375ef20 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Sat, 21 Jan 2012 15:28:51 +0100 Subject: test/: Add generic tests for todo operations * todo-001.sh: Tests the "-t" command line option (calculates expected output by parsing the todo data file). * todo-002.sh: Tests "-t" in a way similar to todo-001.sh. * todo-003.sh: Tests "-t0" in a way similar to todo-001.sh. Signed-off-by: Lukas Fleischer --- test/todo-001.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 test/todo-001.sh (limited to 'test/todo-001.sh') diff --git a/test/todo-001.sh b/test/todo-001.sh new file mode 100755 index 0000000..f607b30 --- /dev/null +++ b/test/todo-001.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +if [ "$1" = 'actual' ]; then + calcurse -D data/ -t | sort +elif [ "$1" = 'expected' ]; then + ( + echo 'to do:' + sed '/^\[-/d; s/^\[\([0-9]\)\] \(.*\)/\1. \2/' data/todo + ) | sort +else + ./run-test "$0" +fi -- cgit v1.2.3-54-g00ecf