diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2013-02-26 22:17:29 +0100 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2013-02-27 11:36:28 +0100 |
commit | 5501dae32874bf3f65f7619aa76c6a213bbce321 (patch) | |
tree | d5edc81f68f860aba6dd580eefd8c6ea393ec605 | |
parent | 3d7fdaec584ad7080d187b8aa53c6546d9c1d8d7 (diff) | |
download | calcurse-5501dae32874bf3f65f7619aa76c6a213bbce321.tar.gz calcurse-5501dae32874bf3f65f7619aa76c6a213bbce321.zip |
test/: Add a couple of black-box tests for items
This introduces five test suite failures which will be fixed in one of
the following patches.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
55 files changed, 251 insertions, 0 deletions
diff --git a/test/Makefile.am b/test/Makefile.am index 77142df..d88463b 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -14,6 +14,33 @@ TESTS = \ range-002.sh \ range-003.sh \ appointment-001.sh \ + appointment-002.sh \ + appointment-003.sh \ + appointment-004.sh \ + appointment-005.sh \ + appointment-006.sh \ + appointment-007.sh \ + appointment-008.sh \ + appointment-009.sh \ + appointment-010.sh \ + appointment-011.sh \ + appointment-012.sh \ + appointment-013.sh \ + appointment-014.sh \ + appointment-015.sh \ + appointment-016.sh \ + appointment-017.sh \ + appointment-018.sh \ + appointment-019.sh \ + appointment-020.sh \ + appointment-021.sh \ + appointment-022.sh \ + event-001.sh \ + event-002.sh \ + event-003.sh \ + event-004.sh \ + event-005.sh \ + event-006.sh \ next-001.sh \ search-001.sh \ bug-002.sh \ diff --git a/test/appointment-002.sh b/test/appointment-002.sh new file mode 100755 index 0000000..5a85c6a --- /dev/null +++ b/test/appointment-002.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +if [ "$1" = 'actual' ]; then + "$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-appointment-002" \ + -d02/23/2013 +elif [ "$1" = 'expected' ]; then + cat <<EOD +02/23/13: + - 10:00 -> 12:00 + Appointment +EOD +else + ./run-test "$0" +fi diff --git a/test/appointment-003.sh b/test/appointment-003.sh new file mode 100755 index 0000000..389fa13 --- /dev/null +++ b/test/appointment-003.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +if [ "$1" = 'actual' ]; then + "$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-appointment-003" \ + -d02/23/2013 +elif [ "$1" = 'expected' ]; then + cat <<EOD +02/23/13: + - 10:00 -> ..:.. + Appointment +EOD +else + ./run-test "$0" +fi diff --git a/test/appointment-004.sh b/test/appointment-004.sh new file mode 100755 index 0000000..cbab131 --- /dev/null +++ b/test/appointment-004.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +if [ "$1" = 'actual' ]; then + "$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-appointment-004" \ + -d02/23/2013 +elif [ "$1" = 'expected' ]; then + cat <<EOD +02/23/13: + - ..:.. -> 12:00 + Appointment +EOD +else + ./run-test "$0" +fi diff --git a/test/appointment-005.sh b/test/appointment-005.sh new file mode 100755 index 0000000..54a0acc --- /dev/null +++ b/test/appointment-005.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +if [ "$1" = 'actual' ]; then + "$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-appointment-005" \ + -d02/23/2013 +elif [ "$1" = 'expected' ]; then + cat <<EOD +02/23/13: + - ..:.. -> ..:.. + Appointment +EOD +else + ./run-test "$0" +fi diff --git a/test/appointment-006.sh b/test/appointment-006.sh new file mode 100755 index 0000000..3746f5a --- /dev/null +++ b/test/appointment-006.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +if [ "$1" = 'actual' ]; then + "$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-appointment-006" \ + -d02/23/2013 +elif [ "$1" = 'expected' ]; then + cat <<EOD +02/23/13: + - 10:00 -> 12:00 + Appointment +EOD +else + ./run-test "$0" +fi diff --git a/test/appointment-007.sh b/test/appointment-007.sh new file mode 100755 index 0000000..a097e02 --- /dev/null +++ b/test/appointment-007.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +if [ "$1" = 'actual' ]; then + "$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-appointment-007" \ + -d02/23/2013 +elif [ "$1" = 'expected' ]; then + cat <<EOD +02/23/13: + - 10:00 -> 12:00 + Appointment +EOD +else + ./run-test "$0" +fi diff --git a/test/appointment-008.sh b/test/appointment-008.sh new file mode 100755 index 0000000..b50c200 --- /dev/null +++ b/test/appointment-008.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +"$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-appointment-008" \ + -d02/23/2013 2>errors && exit 1 +grep -Fq 'syntax error in the item date' errors diff --git a/test/appointment-009.sh b/test/appointment-009.sh new file mode 100755 index 0000000..0e7bd33 --- /dev/null +++ b/test/appointment-009.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +"$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-appointment-009" \ + -d02/23/2013 2>errors && exit 1 +grep -Fq 'date error in appointment' errors diff --git a/test/appointment-010.sh b/test/appointment-010.sh new file mode 100755 index 0000000..20b7b48 --- /dev/null +++ b/test/appointment-010.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +"$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-appointment-010" \ + -d02/23/2013 2>errors && exit 1 +grep -Fq 'no event nor appointment found' errors diff --git a/test/appointment-011.sh b/test/appointment-011.sh new file mode 100755 index 0000000..94098fb --- /dev/null +++ b/test/appointment-011.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +"$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-appointment-011" \ + -d02/23/2013 2>errors && exit 1 +grep -Fq 'syntax error in item time or duration' errors diff --git a/test/appointment-012.sh b/test/appointment-012.sh new file mode 100755 index 0000000..9cf80b6 --- /dev/null +++ b/test/appointment-012.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +"$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-appointment-012" \ + -d02/23/2013 2>errors && exit 1 +grep -Fq 'date error in appointment' errors diff --git a/test/appointment-013.sh b/test/appointment-013.sh new file mode 100755 index 0000000..5ab608f --- /dev/null +++ b/test/appointment-013.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +"$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-appointment-013" \ + -d02/23/2013 2>errors && exit 1 +grep -Fq 'syntax error in item time or duration' errors diff --git a/test/appointment-014.sh b/test/appointment-014.sh new file mode 100755 index 0000000..ba67f41 --- /dev/null +++ b/test/appointment-014.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +"$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-appointment-014" \ + -d02/23/2013 2>errors && exit 1 +grep -Fq 'syntax error in item time or duration' errors diff --git a/test/appointment-015.sh b/test/appointment-015.sh new file mode 100755 index 0000000..be59baa --- /dev/null +++ b/test/appointment-015.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +"$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-appointment-015" \ + -d02/23/2013 2>errors && exit 1 +grep -Fq 'syntax error in item time or duration' errors diff --git a/test/appointment-016.sh b/test/appointment-016.sh new file mode 100755 index 0000000..9103b50 --- /dev/null +++ b/test/appointment-016.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +"$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-appointment-016" \ + -d02/23/2013 2>errors && exit 1 +grep -Fq 'date error in appointment' errors diff --git a/test/appointment-017.sh b/test/appointment-017.sh new file mode 100755 index 0000000..274e9a1 --- /dev/null +++ b/test/appointment-017.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +"$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-appointment-017" \ + -d02/23/2013 2>errors && exit 1 +grep -Fq 'syntax error in item time or duration' errors diff --git a/test/appointment-018.sh b/test/appointment-018.sh new file mode 100755 index 0000000..2124074 --- /dev/null +++ b/test/appointment-018.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +"$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-appointment-018" \ + -d02/23/2013 2>errors && exit 1 +grep -Fq 'syntax error in item time or duration' errors diff --git a/test/appointment-019.sh b/test/appointment-019.sh new file mode 100755 index 0000000..d29fa8f --- /dev/null +++ b/test/appointment-019.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +"$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-appointment-019" \ + -d02/23/2013 2>errors && exit 1 +grep -Fq 'date error in appointment' errors diff --git a/test/appointment-020.sh b/test/appointment-020.sh new file mode 100755 index 0000000..78e4db6 --- /dev/null +++ b/test/appointment-020.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +"$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-appointment-020" \ + -d02/23/2013 2>errors && exit 1 +grep -Fq 'syntax error in item repetition' errors diff --git a/test/appointment-021.sh b/test/appointment-021.sh new file mode 100755 index 0000000..f0db9b8 --- /dev/null +++ b/test/appointment-021.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +"$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-appointment-021" \ + -d02/23/2013 2>errors && exit 1 +grep -Fq 'date error in appointment' errors diff --git a/test/appointment-022.sh b/test/appointment-022.sh new file mode 100755 index 0000000..4e72b73 --- /dev/null +++ b/test/appointment-022.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +"$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-appointment-022" \ + -d02/23/2013 2>errors && exit 1 +grep -Fq 'date error in appointment' errors diff --git a/test/data/apts-appointment-002 b/test/data/apts-appointment-002 new file mode 100644 index 0000000..b902eee --- /dev/null +++ b/test/data/apts-appointment-002 @@ -0,0 +1 @@ +02/23/2013 @ 10:00 -> 02/23/2013 @ 12:00 |Appointment diff --git a/test/data/apts-appointment-003 b/test/data/apts-appointment-003 new file mode 100644 index 0000000..f6ede4d --- /dev/null +++ b/test/data/apts-appointment-003 @@ -0,0 +1 @@ +02/23/2013 @ 10:00 -> 02/24/2013 @ 12:00 |Appointment diff --git a/test/data/apts-appointment-004 b/test/data/apts-appointment-004 new file mode 100644 index 0000000..2a28c59 --- /dev/null +++ b/test/data/apts-appointment-004 @@ -0,0 +1 @@ +02/22/2013 @ 10:00 -> 02/23/2013 @ 12:00 |Appointment diff --git a/test/data/apts-appointment-005 b/test/data/apts-appointment-005 new file mode 100644 index 0000000..7eebfc3 --- /dev/null +++ b/test/data/apts-appointment-005 @@ -0,0 +1 @@ +02/22/2013 @ 10:00 -> 02/24/2013 @ 12:00 |Appointment diff --git a/test/data/apts-appointment-006 b/test/data/apts-appointment-006 new file mode 100644 index 0000000..7bce6ba --- /dev/null +++ b/test/data/apts-appointment-006 @@ -0,0 +1 @@ +02/23/2013 @ 10:00 -> 02/23/2013 @ 12:00 !Appointment diff --git a/test/data/apts-appointment-007 b/test/data/apts-appointment-007 new file mode 100644 index 0000000..d832fd8 --- /dev/null +++ b/test/data/apts-appointment-007 @@ -0,0 +1 @@ +02/23/2013 @ 10:00 -> 02/23/2013 @ 12:00 >ce96f39624a379da19b5549bad6b9a8beed24403 |Appointment diff --git a/test/data/apts-appointment-008 b/test/data/apts-appointment-008 new file mode 100644 index 0000000..232ebbc --- /dev/null +++ b/test/data/apts-appointment-008 @@ -0,0 +1 @@ +02.23.2013 @ 10:00 -> 02/23/2013 @ 12:00 |Appointment diff --git a/test/data/apts-appointment-009 b/test/data/apts-appointment-009 new file mode 100644 index 0000000..39a2aa1 --- /dev/null +++ b/test/data/apts-appointment-009 @@ -0,0 +1 @@ +01/32/2013 @ 10:00 -> 02/23/2013 @ 12:00 |Appointment diff --git a/test/data/apts-appointment-010 b/test/data/apts-appointment-010 new file mode 100644 index 0000000..117c7b7 --- /dev/null +++ b/test/data/apts-appointment-010 @@ -0,0 +1 @@ +02/23/2013 . 10:00 -> 02/23/2013 @ 12:00 |Appointment diff --git a/test/data/apts-appointment-011 b/test/data/apts-appointment-011 new file mode 100644 index 0000000..2af8661 --- /dev/null +++ b/test/data/apts-appointment-011 @@ -0,0 +1 @@ +02/23/2013 @ 10.00 -> 02/23/2013 @ 12:00 |Appointment diff --git a/test/data/apts-appointment-012 b/test/data/apts-appointment-012 new file mode 100644 index 0000000..e61e746 --- /dev/null +++ b/test/data/apts-appointment-012 @@ -0,0 +1 @@ +02/22/2013 @ 24:00 -> 02/23/2013 @ 12:00 |Appointment diff --git a/test/data/apts-appointment-013 b/test/data/apts-appointment-013 new file mode 100644 index 0000000..3617a8b --- /dev/null +++ b/test/data/apts-appointment-013 @@ -0,0 +1 @@ +02/23/2013 @ 10:00 .> 02/23/2013 @ 12:00 |Appointment diff --git a/test/data/apts-appointment-014 b/test/data/apts-appointment-014 new file mode 100644 index 0000000..e351ef2 --- /dev/null +++ b/test/data/apts-appointment-014 @@ -0,0 +1 @@ +02/23/2013 @ 10:00 -. 02/23/2013 @ 12:00 |Appointment diff --git a/test/data/apts-appointment-015 b/test/data/apts-appointment-015 new file mode 100644 index 0000000..4353afc --- /dev/null +++ b/test/data/apts-appointment-015 @@ -0,0 +1 @@ +02/23/2013 @ 10:00 -> 02.23.2013 @ 12:00 |Appointment diff --git a/test/data/apts-appointment-016 b/test/data/apts-appointment-016 new file mode 100644 index 0000000..8d51b1e --- /dev/null +++ b/test/data/apts-appointment-016 @@ -0,0 +1 @@ +02/23/2013 @ 10:00 -> 02/29/2013 @ 12:00 |Appointment diff --git a/test/data/apts-appointment-017 b/test/data/apts-appointment-017 new file mode 100644 index 0000000..4f62b1d --- /dev/null +++ b/test/data/apts-appointment-017 @@ -0,0 +1 @@ +02/23/2013 @ 10:00 -> 02/23/2013 . 12:00 |Appointment diff --git a/test/data/apts-appointment-018 b/test/data/apts-appointment-018 new file mode 100644 index 0000000..5586fe4 --- /dev/null +++ b/test/data/apts-appointment-018 @@ -0,0 +1 @@ +02/23/2013 @ 10:00 -> 02/23/2013 @ 12.00 |Appointment diff --git a/test/data/apts-appointment-019 b/test/data/apts-appointment-019 new file mode 100644 index 0000000..2cbe077 --- /dev/null +++ b/test/data/apts-appointment-019 @@ -0,0 +1 @@ +02/23/2013 @ 10:00 -> 02/23/2013 @ 24:00 |Appointment diff --git a/test/data/apts-appointment-020 b/test/data/apts-appointment-020 new file mode 100644 index 0000000..ac0b792 --- /dev/null +++ b/test/data/apts-appointment-020 @@ -0,0 +1 @@ +02/23/2013 @ 10:00 -> 02/23/2013 @ 12:00 .Appointment diff --git a/test/data/apts-appointment-021 b/test/data/apts-appointment-021 new file mode 100644 index 0000000..6261850 --- /dev/null +++ b/test/data/apts-appointment-021 @@ -0,0 +1 @@ +02/23/2013 @ 10:00 -> 02/23/2013 @ 08:00 |Appointment diff --git a/test/data/apts-appointment-022 b/test/data/apts-appointment-022 new file mode 100644 index 0000000..0be2a25 --- /dev/null +++ b/test/data/apts-appointment-022 @@ -0,0 +1 @@ +02/23/2013 @ 10:00 -> 02/22/2013 @ 12:00 |Appointment diff --git a/test/data/apts-event-001 b/test/data/apts-event-001 new file mode 100644 index 0000000..356fc14 --- /dev/null +++ b/test/data/apts-event-001 @@ -0,0 +1 @@ +02/23/2013 [1] Event diff --git a/test/data/apts-event-002 b/test/data/apts-event-002 new file mode 100644 index 0000000..0394779 --- /dev/null +++ b/test/data/apts-event-002 @@ -0,0 +1 @@ +02.23.2013 [1] Event diff --git a/test/data/apts-event-003 b/test/data/apts-event-003 new file mode 100644 index 0000000..9f8b5b9 --- /dev/null +++ b/test/data/apts-event-003 @@ -0,0 +1 @@ +02/29/2013 [1] Event diff --git a/test/data/apts-event-004 b/test/data/apts-event-004 new file mode 100644 index 0000000..c3d1296 --- /dev/null +++ b/test/data/apts-event-004 @@ -0,0 +1 @@ +02/23/2013 .1] Event diff --git a/test/data/apts-event-005 b/test/data/apts-event-005 new file mode 100644 index 0000000..22e00d1 --- /dev/null +++ b/test/data/apts-event-005 @@ -0,0 +1 @@ +02/23/2013 [.] Event diff --git a/test/data/apts-event-006 b/test/data/apts-event-006 new file mode 100644 index 0000000..b96e7e7 --- /dev/null +++ b/test/data/apts-event-006 @@ -0,0 +1 @@ +02/23/2013 [1. Event diff --git a/test/event-001.sh b/test/event-001.sh new file mode 100755 index 0000000..6496309 --- /dev/null +++ b/test/event-001.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +if [ "$1" = 'actual' ]; then + "$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-event-001" \ + -d02/23/2013 +elif [ "$1" = 'expected' ]; then + cat <<EOD +02/23/13: + * Event +EOD +else + ./run-test "$0" +fi diff --git a/test/event-002.sh b/test/event-002.sh new file mode 100755 index 0000000..0a101e2 --- /dev/null +++ b/test/event-002.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +"$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-event-002" \ + -d02/23/2013 2>errors && exit 1 +grep -Fq 'syntax error in the item date' errors diff --git a/test/event-003.sh b/test/event-003.sh new file mode 100755 index 0000000..2e18b0c --- /dev/null +++ b/test/event-003.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +"$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-event-003" \ + -d02/23/2013 2>errors && exit 1 +grep -Fq 'date error in event' errors diff --git a/test/event-004.sh b/test/event-004.sh new file mode 100755 index 0000000..cb4d036 --- /dev/null +++ b/test/event-004.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +"$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-event-004" \ + -d02/23/2013 2>errors && exit 1 +grep -Fq 'no event nor appointment found' errors diff --git a/test/event-005.sh b/test/event-005.sh new file mode 100755 index 0000000..5504973 --- /dev/null +++ b/test/event-005.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +"$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-event-005" \ + -d02/23/2013 2>errors && exit 1 +grep -Fq 'syntax error in item identifier' errors diff --git a/test/event-006.sh b/test/event-006.sh new file mode 100755 index 0000000..329a16e --- /dev/null +++ b/test/event-006.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +"$CALCURSE" --read-only -D "$DATA_DIR"/ -c "$DATA_DIR/apts-event-006" \ + -d02/23/2013 2>errors && exit 1 +grep -Fq 'syntax error in item identifier' errors |