summaryrefslogtreecommitdiff
path: root/test/tests/inject/recips
diff options
context:
space:
mode:
Diffstat (limited to 'test/tests/inject/recips')
-rw-r--r--test/tests/inject/recips50
1 files changed, 50 insertions, 0 deletions
diff --git a/test/tests/inject/recips b/test/tests/inject/recips
new file mode 100644
index 0000000..008a2cb
--- /dev/null
+++ b/test/tests/inject/recips
@@ -0,0 +1,50 @@
+. functions
+
+inj() { inject -n -v "$@" | tail -n +2 | sed '/^$/,$d'; }
+inj-find() { echo to: a@b.c | inj "$1" d@e.f | grep -q "$2"; }
+inj-notfind() { echo to: a@b.c | inj "$1" d@e.f | not grep -q "$2"; }
+
+hdrline='^a@b.c$'
+cmdline='^d@e.f$'
+
+echo "Checking that inject uses command line with -a."
+inj-find -a $cmdline
+
+echo "Checking that inject ignores header lines with -a."
+inj-notfind -a $hdrline
+
+echo "Checking that inject uses command line with -b."
+inj-find -b $cmdline
+
+echo "Checking that inject uses header lines with -b."
+inj-find -b $hdrline
+
+echo "Checking that inject ignores command line with -h."
+inj-notfind -h $cmdline
+
+echo "Checking that inject uses header lines with -h."
+inj-find -h $hdrline
+
+echo "Checking that inject uses command line with -e and no header."
+echo | inj -e d@e.f | grep -q $cmdline
+
+echo "Checking that inject uses command line with -e and header."
+inj-find -e $cmdline
+
+echo "Checking that inject uses header with -e and no command line."
+echo to: a@b.c | inj -e | grep -q $hdrline
+
+echo "Checking that inject ignores header with -e and command line."
+inj-notfind -e $hdrline
+
+echo "Checking that inject uses command line with no header by default."
+echo | inj -e d@e.f | grep -q $cmdline
+
+echo "Checking that inject uses command line with header by default."
+inj-find -e $cmdline
+
+echo "Checking that inject uses header with no command line by default."
+echo to: a@b.c | inj -e | grep -q $hdrline
+
+echo "Checking that inject ignores header with command line by default."
+inj-notfind -e $hdrline