aboutsummaryrefslogtreecommitdiff
path: root/tests/date.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/date.test')
-rw-r--r--tests/date.test10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/date.test b/tests/date.test
new file mode 100644
index 00000000..d72e50cf
--- /dev/null
+++ b/tests/date.test
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+[ -f testing.sh ] && . testing.sh
+
+#testing "name" "command" "result" "infile" "stdin"
+
+# Accidentally given a Unix time, we should trivially reject that.
+testing "date Unix time" "date 1438053157 2>&1" "date: bad date '1438053157'\n" "" ""
+# But some invalid dates are more subtle, like Febuary 29th in a non-leap year.
+testing "date Feb 29th" "date 022900001975 2>&1" "date: bad date