Sat Oct 31 19:55:26 2020 UTC ()
make(1): add test for :gmtime with space before the number of seconds


(rillig)
diff -r1.3 -r1.4 src/usr.bin/make/unit-tests/varmod-gmtime.exp
diff -r1.4 -r1.5 src/usr.bin/make/unit-tests/varmod-gmtime.mk

cvs diff -r1.3 -r1.4 src/usr.bin/make/unit-tests/varmod-gmtime.exp (expand / switch to context diff)
--- src/usr.bin/make/unit-tests/varmod-gmtime.exp 2020/10/31 19:48:23 1.3
+++ src/usr.bin/make/unit-tests/varmod-gmtime.exp 2020/10/31 19:55:26 1.4
@@ -8,6 +8,7 @@
 
 parse-errors:
 : -1 becomes Wed Dec 31 23:59:59 1969.
+: space 1 becomes Thu Jan  1 00:00:01 1970.
 : 0 becomes ok.
 : 1 becomes Thu Jan  1 00:00:01 1970.
 : INT32_MAX becomes Tue Jan 19 03:14:07 2038.

cvs diff -r1.4 -r1.5 src/usr.bin/make/unit-tests/varmod-gmtime.mk (expand / switch to context diff)
--- src/usr.bin/make/unit-tests/varmod-gmtime.mk 2020/10/31 19:48:23 1.4
+++ src/usr.bin/make/unit-tests/varmod-gmtime.mk 2020/10/31 19:55:26 1.5
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-gmtime.mk,v 1.4 2020/10/31 19:48:23 rillig Exp $
+# $NetBSD: varmod-gmtime.mk,v 1.5 2020/10/31 19:55:26 rillig Exp $
 #
 # Tests for the :gmtime variable modifier, which formats a timestamp
 # using strftime(3).
@@ -48,6 +48,10 @@
 	# Going back 50 years in the past is not a practical use case for
 	# make.
 	: -1 becomes ${:L:gmtime=-1}.
+
+	# Spaces are allowed, not because it would make sense but just as
+	# a side-effect from using strtoul.
+	: space 1 becomes ${:L:gmtime= 1}.
 
 	# 0 means now; to get consistent test results, the actual value has
 	# to be normalized.