xref: /freebsd/contrib/bmake/unit-tests/varmod-to-upper.mk (revision 956e45f6fb3e18b8e89b1341708db60c30bb9f27)
1*956e45f6SSimon J. Gerraty# $NetBSD: varmod-to-upper.mk,v 1.5 2020/10/24 08:46:08 rillig Exp $
22c3632d1SSimon J. Gerraty#
32c3632d1SSimon J. Gerraty# Tests for the :tu variable modifier, which returns the words in the
42c3632d1SSimon J. Gerraty# variable value, converted to uppercase.
52c3632d1SSimon J. Gerraty
62c3632d1SSimon J. Gerraty.if ${:UUPPER:tu} != "UPPER"
72c3632d1SSimon J. Gerraty.  error
82c3632d1SSimon J. Gerraty.endif
92c3632d1SSimon J. Gerraty
102c3632d1SSimon J. Gerraty.if ${:Ulower:tu} != "LOWER"
112c3632d1SSimon J. Gerraty.  error
122c3632d1SSimon J. Gerraty.endif
132c3632d1SSimon J. Gerraty
142c3632d1SSimon J. Gerraty.if ${:UMixeD case.:tu} != "MIXED CASE."
152c3632d1SSimon J. Gerraty.  error
162c3632d1SSimon J. Gerraty.endif
172c3632d1SSimon J. Gerraty
182c3632d1SSimon J. Gerraty# The :tu and :tl modifiers operate on the variable value as a single string,
192c3632d1SSimon J. Gerraty# not as a list of words. Therefore, the adjacent spaces are preserved.
202c3632d1SSimon J. Gerratymod-tu-space:
212c3632d1SSimon J. Gerraty	@echo $@: ${a   b:L:tu:Q}
22