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-003.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 test/todo-003.sh (limited to 'test/todo-003.sh') diff --git a/test/todo-003.sh b/test/todo-003.sh new file mode 100755 index 0000000..ecec032 --- /dev/null +++ b/test/todo-003.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +if [ "$1" = 'actual' ]; then + calcurse -D data/ -t0 | sort -n +elif [ "$1" = 'expected' ]; then + ( + echo 'completed tasks:' + sed -n 's/^\[-\([0-9]\)\] \(.*\)/\1. \2/p' data/todo + ) | sort -n +else + ./run-test "$0" +fi -- cgit v1.2.3-54-g00ecf