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