Home | History | Annotate | Line # | Download | only in unit-tests
varmod-unique.mk revision 1.4
      1  1.4  rillig # $NetBSD: varmod-unique.mk,v 1.4 2020/08/31 17:41:38 rillig Exp $
      2  1.1  rillig #
      3  1.2  rillig # Tests for the :u variable modifier, which discards adjacent duplicate
      4  1.2  rillig # words.
      5  1.1  rillig 
      6  1.3  rillig .if ${:U1 2 1:u} != "1 2 1"
      7  1.4  rillig .  warning The :u modifier only merges _adjacent_ duplicate words.
      8  1.3  rillig .endif
      9  1.3  rillig 
     10  1.3  rillig .if ${:U1 2 2 3:u} != "1 2 3"
     11  1.3  rillig .  warning The :u modifier must merge adjacent duplicate words.
     12  1.3  rillig .endif
     13  1.3  rillig 
     14  1.3  rillig .if ${:U:u} != ""
     15  1.4  rillig .  warning The :u modifier must do nothing with an empty word list.
     16  1.3  rillig .endif
     17  1.3  rillig 
     18  1.3  rillig .if ${:U1:u} != "1"
     19  1.4  rillig .  warning The :u modifier must do nothing with a single-element word list.
     20  1.3  rillig .endif
     21  1.3  rillig 
     22  1.4  rillig .if ${:U1 1 1 1 1 1 1 1:u} != "1"
     23  1.3  rillig .  warning The :u modifier must merge _all_ adjacent duplicate words.
     24  1.3  rillig .endif
     25  1.3  rillig 
     26  1.4  rillig .if ${:U   1    2    1 1  :u} != "1 2 1"
     27  1.3  rillig .  warning The :u modifier must normalize whitespace between the words.
     28  1.4  rillig .endif
     29  1.4  rillig 
     30  1.4  rillig .if ${:U1 1 1 1 2:u} != "1 2"
     31  1.4  rillig .  warning Duplicate words at the beginning must be merged.
     32  1.4  rillig .endif
     33  1.4  rillig 
     34  1.4  rillig .if ${:U1 2 2 2 2:u} != "1 2"
     35  1.4  rillig .  warning Duplicate words at the end must be merged.
     36  1.3  rillig .endif
     37  1.1  rillig 
     38  1.1  rillig all:
     39  1.1  rillig 	@:;
     40