commit: f9d1066e60f0bd6323bc2ae06c37de4b843406b7
parent 64db870a04ed8533f80b25d7db09acfc4ad36643
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Fri, 11 Feb 2022 20:47:54 +0100
test-bin/date: New
Diffstat:
2 files changed, 31 insertions(+), 0 deletions(-)
diff --git a/test-bin/Kyuafile b/test-bin/Kyuafile
@@ -8,6 +8,7 @@ basedir = fs.dirname(fs.dirname(current_kyuafile()))
atf_test_program{name="args", required_files=basedir.."/bin/args"}
atf_test_program{name="basename", required_files=basedir.."/bin/basename"}
atf_test_program{name="cat", required_files=basedir.."/bin/cat"}
+atf_test_program{name="date", required_files=basedir.."/bin/date"}
atf_test_program{name="dirname", required_files=basedir.."/bin/dirname"}
atf_test_program{name="echo", required_files=basedir.."/bin/echo"}
atf_test_program{name="false", required_files=basedir.."/bin/false"}
diff --git a/test-bin/date b/test-bin/date
@@ -0,0 +1,30 @@
+#!/usr/bin/env atf-sh
+atf_test_case noargs
+noargs_body() {
+ atf_check -o not-empty ../bin/date
+}
+
+atf_test_case epoch
+epoch_body() {
+ atf_check -o "match:^[0-9]+$" ../bin/date '+%s'
+}
+
+atf_test_case devfull
+devfull_body() {
+ atf_check -s exit:1 -e 'inline:puts: No space left on device\n' sh -c '../bin/date >/dev/full'
+}
+
+atf_test_case utc
+utc_body() {
+ atf_check -o "match:^[0-9]+$" ../bin/date -u '+%s'
+}
+
+atf_init_test_cases() {
+ cd "$(atf_get_srcdir)"
+ atf_add_test_case noargs
+ atf_add_test_case epoch
+ atf_add_test_case utc
+
+ # glibc
+ #atf_add_test_case devfull
+}