Home | History | Annotate | Line # | Download | only in unit-tests
varmod-unique.mk revision 1.3
      1  1.3  rillig # $NetBSD: varmod-unique.mk,v 1.3 2020/08/31 17:32:13 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.3  rillig .  error 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 .  if ${:U1 2 2 3:u} == "1 2 3 3" # not the desired result
     13  1.3  rillig .    warning FIXME
     14  1.3  rillig .  endif
     15  1.3  rillig .endif
     16  1.3  rillig 
     17  1.3  rillig .if ${:U:u} != ""
     18  1.3  rillig .  error The :u modifier must do nothing with an empty word list.
     19  1.3  rillig .endif
     20  1.3  rillig 
     21  1.3  rillig .if ${:U1:u} != "1"
     22  1.3  rillig .  error The :u modifier must do nothing with a single-element word list.
     23  1.3  rillig .endif
     24  1.3  rillig 
     25  1.3  rillig .if ${:U1 1 1 1 1 1 1 1} != "1"
     26  1.3  rillig .  warning The :u modifier must merge _all_ adjacent duplicate words.
     27  1.3  rillig .  if ${:U1 1 1 1 1 1 1 1} == "1 1 1 1 1 1 1 1"
     28  1.3  rillig .    warning FIXME
     29  1.3  rillig .  endif
     30  1.3  rillig .endif
     31  1.3  rillig 
     32  1.3  rillig .if ${:U   1    2    1 1  } != "1 2 1"
     33  1.3  rillig .  warning The :u modifier must normalize whitespace between the words.
     34  1.3  rillig .  if ${:U   1    2    1 1  } != "1 2 1 1"
     35  1.3  rillig .    warning FIXME
     36  1.3  rillig .  endif
     37  1.3  rillig .endif
     38  1.1  rillig 
     39  1.1  rillig all:
     40  1.1  rillig 	@:;
     41