aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2015-04-13 16:21:22 +0300
committerArnold D. Robbins <arnold@skeeve.com>2015-04-13 16:21:22 +0300
commitf156eb53457a9e4e34c1b96f9e54eb130dffd8a3 (patch)
tree793b7346af079f55e1c1d4abd490413218fa1a95 /test
parent0325b4daf737414c3b811b05c70b897b807a436b (diff)
downloadegawk-f156eb53457a9e4e34c1b96f9e54eb130dffd8a3.tar.gz
egawk-f156eb53457a9e4e34c1b96f9e54eb130dffd8a3.tar.bz2
egawk-f156eb53457a9e4e34c1b96f9e54eb130dffd8a3.zip
Remove fatal error if strftime timestamp < 0.
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog5
-rw-r--r--test/Makefile.am10
-rw-r--r--test/Makefile.in9
-rw-r--r--test/negtime.awk4
-rw-r--r--test/negtime.ok1
5 files changed, 27 insertions, 2 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index 10d707cd..0092932f 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-13 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (negtime): New test.
+ * negtime.awk, negtime.ok: New files.
+
2015-04-09 Arnold D. Robbins <arnold@skeeve.com>
* fts.awk: Skip atime to avoid spurious timestamp
diff --git a/test/Makefile.am b/test/Makefile.am
index 3973c666..e2ccdc56 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -569,6 +569,8 @@ EXTRA_DIST = \
negexp.ok \
negrange.awk \
negrange.ok \
+ negtime.awk \
+ negtime.ok \
nested.awk \
nested.in \
nested.ok \
@@ -1050,7 +1052,7 @@ GAWK_EXT_TESTS = \
include include2 indirectbuiltin indirectcall indirectcall2 \
lint lintold lintwarn \
manyfiles match1 match2 match3 mbstr1 \
- nastyparm next nondec nondec2 \
+ nastyparm negtime next nondec nondec2 \
patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge procinfs \
profile0 profile1 profile2 profile3 profile4 profile5 profile6 profile7 pty1 \
rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \
@@ -2055,6 +2057,12 @@ paramasfunc2::
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk --posix >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+negtime::
+ @echo $@
+ @TZ=GMT AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+
# Targets generated for other tests:
include Maketests
diff --git a/test/Makefile.in b/test/Makefile.in
index c1b691e7..6ed035fd 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -826,6 +826,8 @@ EXTRA_DIST = \
negexp.ok \
negrange.awk \
negrange.ok \
+ negtime.awk \
+ negtime.ok \
nested.awk \
nested.in \
nested.ok \
@@ -1306,7 +1308,7 @@ GAWK_EXT_TESTS = \
include include2 indirectbuiltin indirectcall indirectcall2 \
lint lintold lintwarn \
manyfiles match1 match2 match3 mbstr1 \
- nastyparm next nondec nondec2 \
+ nastyparm negtime next nondec nondec2 \
patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge procinfs \
profile0 profile1 profile2 profile3 profile4 profile5 profile6 profile7 pty1 \
rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \
@@ -2491,6 +2493,11 @@ paramasfunc2::
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk --posix >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+negtime::
+ @echo $@
+ @TZ=GMT AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
Gt-dummy:
# file Maketests, generated from Makefile.am by the Gentests program
addcomma:
diff --git a/test/negtime.awk b/test/negtime.awk
new file mode 100644
index 00000000..743c6d05
--- /dev/null
+++ b/test/negtime.awk
@@ -0,0 +1,4 @@
+BEGIN {
+then = mktime("1959 12 15 7 00 00")
+print strftime(PROCINFO["strftime"], then)
+}
diff --git a/test/negtime.ok b/test/negtime.ok
new file mode 100644
index 00000000..aa2ae694
--- /dev/null
+++ b/test/negtime.ok
@@ -0,0 +1 @@
+Tue Dec 15 07:00:00 GMT 1959