Module Name:    src
Committed By:   rillig
Date:           Thu Oct 29 19:01:11 UTC 2020

Modified Files:
        src/usr.bin/make/unit-tests: varmod-localtime.mk

Log Message:
make(1): add test for default format of the :localtime modifier


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/varmod-localtime.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/unit-tests/varmod-localtime.mk
diff -u src/usr.bin/make/unit-tests/varmod-localtime.mk:1.3 src/usr.bin/make/unit-tests/varmod-localtime.mk:1.4
--- src/usr.bin/make/unit-tests/varmod-localtime.mk:1.3	Sun Aug 23 15:13:21 2020
+++ src/usr.bin/make/unit-tests/varmod-localtime.mk	Thu Oct 29 19:01:10 2020
@@ -1,8 +1,16 @@
-# $NetBSD: varmod-localtime.mk,v 1.3 2020/08/23 15:13:21 rillig Exp $
+# $NetBSD: varmod-localtime.mk,v 1.4 2020/10/29 19:01:10 rillig Exp $
 #
 # Tests for the :localtime variable modifier, which returns the given time,
 # formatted as a local timestamp.
 
+# Test for the default time format, %c.  Since the time always varies, it's
+# only possible to check for the general format here.  The names of the
+# month and weekday are always in English, independent from the locale.
+# Example: Thu Oct 29 18:56:41 2020
+.if ${:U:localtime:tW:M??? ??? ?? ??\:??\:?? ????} == ""
+.  error
+.endif
+
 all:
 	@echo ${%Y:L:localtim=1593536400}	# modifier name too short
 	@echo ${%Y:L:localtime=1593536400}	# 2020-07-01T00:00:00Z

Reply via email to