aboutsummaryrefslogtreecommitdiff
path: root/contrib/bmake/unit-tests/varmod-unique.mk
blob: 04d04a575af193d8a03cf172968a3bc57f17ad9d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# $NetBSD: varmod-unique.mk,v 1.5 2021/05/30 20:26:41 rillig Exp $
#
# Tests for the :u variable modifier, which discards adjacent duplicate
# words.

.if ${:U1 2 1:u} != "1 2 1"
.  warning The :u modifier only merges _adjacent_ duplicate words.
.endif

.if ${:U1 2 2 3:u} != "1 2 3"
.  warning The :u modifier must merge adjacent duplicate words.
.endif

.if ${:U:u} != ""
.  warning The :u modifier must do nothing with an empty word list.
.endif

.if ${:U   :u} != ""
.  warning The modifier ':u' must normalize the whitespace.
.endif

.if ${:Uword:u} != "word"
.  warning The :u modifier must do nothing with a single-element word list.
.endif

.if ${:U   word   :u} != "word"
.  warning The modifier ':u' must normalize the whitespace.
.endif

.if ${:U1 1 1 1 1 1 1 1:u} != "1"
.  warning The :u modifier must merge _all_ adjacent duplicate words.
.endif

.if ${:U   1    2    1 1  :u} != "1 2 1"
.  warning The :u modifier must normalize whitespace between the words.
.endif

.if ${:U1 1 1 1 2:u} != "1 2"
.  warning Duplicate words at the beginning must be merged.
.endif

.if ${:U1 2 2 2 2:u} != "1 2"
.  warning Duplicate words at the end must be merged.
.endif

all:
	@:;