From 8ae8df6d9f903cee298e1cc821a73dc6ab916367 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Wed, 16 Mar 2022 22:02:05 -0400 Subject: tests: Add (stub) parse test --- diff --git a/.gitignore b/.gitignore index 01cf14c..07d68cf 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,7 @@ Makefile *.o /version.c /@ +/test-suite.log /atsign-*.tar* /atsign-*/ /MD5SUMS diff --git a/tests/.gitignore b/tests/.gitignore new file mode 100644 index 0000000..7e563b8 --- /dev/null +++ b/tests/.gitignore @@ -0,0 +1,2 @@ +*.log +*.trs diff --git a/tests/local.mk b/tests/local.mk index 8c5797c..95671bc 100644 --- a/tests/local.mk +++ b/tests/local.mk @@ -1,3 +1,5 @@ +TESTS = \ + %reldir%/parse.sh TEST_EXTENSIONS = .sh SH_LOG_DRIVER = \ AM_TAP_AWK='$(AWK)' \ @@ -5,5 +7,7 @@ SH_LOG_DRIVER = \ TOP_BUILDDIR="$(abs_top_builddir)" \ $(SHELL) $(top_srcdir)/build-aux/tap-driver.sh EXTRA_DIST += \ + $(TESTS) \ $(top_srcdir)/build-aux/tap-driver.sh \ - %reldir%/aux/tap-functions.sh + %reldir%/aux/tap-functions.sh \ + %reldir%/parse.sh diff --git a/tests/parse.sh b/tests/parse.sh new file mode 100755 index 0000000..1de2320 --- /dev/null +++ b/tests/parse.sh @@ -0,0 +1,32 @@ +# Tests @'s date/time parsing +# +# Copyright (C) 2022 P. J. McDermott +# +# This file is part of @ +# +# @ is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# @ is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with @. If not, see . + +set -eu + +. "${TOP_SRCDIR}/tests/aux/tap-functions.sh" + +plan_ later + +if [ x"$(TZ=UTC0 "${TOP_BUILDDIR}/@" -d '19700101T000000')" = x'0' ]; then + ok_ -- '19700101T000000' +else + not_ok_ -- '19700101T000000' +fi + +plan_ now -- cgit v0.9.1