xref: /freebsd/contrib/bmake/unit-tests/varmod-to-title.mk (revision 226192822cddc30cacecd55bccb48f39c653058c)
1*22619282SSimon J. Gerraty# $NetBSD: varmod-to-title.mk,v 1.1 2024/07/01 21:02:26 sjg Exp $
2*22619282SSimon J. Gerraty#
3*22619282SSimon J. Gerraty# Tests for the :tc variable modifier, which converts the expression value
4*22619282SSimon J. Gerraty# to lowercase.
5*22619282SSimon J. Gerraty#
6*22619282SSimon J. Gerraty# TODO: What about non-ASCII characters? ISO-8859-1, UTF-8?
7*22619282SSimon J. Gerraty
8*22619282SSimon J. Gerraty.if ${:UUPPER:tt} != "Upper"
9*22619282SSimon J. Gerraty.  error
10*22619282SSimon J. Gerraty.endif
11*22619282SSimon J. Gerraty
12*22619282SSimon J. Gerraty.if ${:Ulower:tt} != "Lower"
13*22619282SSimon J. Gerraty.  error
14*22619282SSimon J. Gerraty.endif
15*22619282SSimon J. Gerraty
16*22619282SSimon J. Gerraty.if ${:UMixeD case.:tt} != "Mixed Case."
17*22619282SSimon J. Gerraty.  error
18*22619282SSimon J. Gerraty.endif
19*22619282SSimon J. Gerraty
20*22619282SSimon J. Gerraty# The ':tt' modifier works on the whole string, without splitting it into
21*22619282SSimon J. Gerraty# words.
22*22619282SSimon J. Gerraty.if ${:Umultiple   spaces:tt} != "Multiple   Spaces"
23*22619282SSimon J. Gerraty.  error
24*22619282SSimon J. Gerraty.endif
25*22619282SSimon J. Gerraty
26*22619282SSimon J. Gerraty# Note words only count if separated by spaces
27*22619282SSimon J. Gerraty.if ${:Uthis&that or os/2:tt} != "This&that Or Os/2"
28*22619282SSimon J. Gerraty.  error
29*22619282SSimon J. Gerraty.endif
30*22619282SSimon J. Gerraty
31*22619282SSimon J. Gerratyall: .PHONY
32