summaryrefslogtreecommitdiff
path: root/test/tests/inject/date
diff options
context:
space:
mode:
Diffstat (limited to 'test/tests/inject/date')
-rw-r--r--test/tests/inject/date12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/tests/inject/date b/test/tests/inject/date
new file mode 100644
index 0000000..9510436
--- /dev/null
+++ b/test/tests/inject/date
@@ -0,0 +1,12 @@
+. functions
+
+inj() { injectfield date 'to: nobody' "$@"; }
+
+echo "Checking that inject inserts a date line."
+test -n "`inj`"
+
+echo "Checking that inject preserves an existing date line."
+inj "date: foo" | grep '^ foo$' >/dev/null
+
+echo "Checking that inject does not add more date lines."
+test 1 -eq `inj "date: foo" | wc -l`