Home | History | Annotate | Line # | Download | only in unit-tests
varmod-localtime.mk revision 1.4
      1 # $NetBSD: varmod-localtime.mk,v 1.4 2020/10/29 19:01:10 rillig Exp $
      2 #
      3 # Tests for the :localtime variable modifier, which returns the given time,
      4 # formatted as a local timestamp.
      5 
      6 # Test for the default time format, %c.  Since the time always varies, it's
      7 # only possible to check for the general format here.  The names of the
      8 # month and weekday are always in English, independent from the locale.
      9 # Example: Thu Oct 29 18:56:41 2020
     10 .if ${:U:localtime:tW:M??? ??? ?? ??\:??\:?? ????} == ""
     11 .  error
     12 .endif
     13 
     14 all:
     15 	@echo ${%Y:L:localtim=1593536400}	# modifier name too short
     16 	@echo ${%Y:L:localtime=1593536400}	# 2020-07-01T00:00:00Z
     17 	@echo ${%Y:L:localtimer=1593536400}	# modifier name too long
     18