Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/make/unit-tests make(1): add test for :gmtime with s...
details: https://anonhg.NetBSD.org/src/rev/0bfa87e9f986
branches: trunk
changeset: 956509:0bfa87e9f986
user: rillig <rillig%NetBSD.org@localhost>
date: Sat Oct 31 19:55:26 2020 +0000
description:
make(1): add test for :gmtime with space before the number of seconds
diffstat:
usr.bin/make/unit-tests/varmod-gmtime.exp | 1 +
usr.bin/make/unit-tests/varmod-gmtime.mk | 6 +++++-
2 files changed, 6 insertions(+), 1 deletions(-)
diffs (31 lines):
diff -r bf375738b5fb -r 0bfa87e9f986 usr.bin/make/unit-tests/varmod-gmtime.exp
--- a/usr.bin/make/unit-tests/varmod-gmtime.exp Sat Oct 31 19:48:23 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-gmtime.exp Sat Oct 31 19:55:26 2020 +0000
@@ -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.
diff -r bf375738b5fb -r 0bfa87e9f986 usr.bin/make/unit-tests/varmod-gmtime.mk
--- a/usr.bin/make/unit-tests/varmod-gmtime.mk Sat Oct 31 19:48:23 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-gmtime.mk Sat Oct 31 19:55:26 2020 +0000
@@ -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).
@@ -49,6 +49,10 @@
# 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.
: 0 becomes ${:L:gmtime=0:C,^... ... .. ..:..:.. 20..$,ok,W}.
Home |
Main Index |
Thread Index |
Old Index