2021-12-18 07:27:22 +00:00
|
|
|
# $NetBSD: varmod-unique.mk,v 1.6 2021/12/05 22:37:58 rillig Exp $
|
2020-09-05 16:11:04 +00:00
|
|
|
#
|
|
|
|
# Tests for the :u variable modifier, which discards adjacent duplicate
|
|
|
|
# words.
|
|
|
|
|
2021-12-18 07:27:22 +00:00
|
|
|
.if ${1 2 1:L:u} != "1 2 1"
|
|
|
|
. warning The modifier ':u' only merges _adjacent_ duplicate words.
|
2020-09-05 16:11:04 +00:00
|
|
|
.endif
|
|
|
|
|
2021-12-18 07:27:22 +00:00
|
|
|
.if ${1 2 2 3:L:u} != "1 2 3"
|
|
|
|
. warning The modifier ':u' must merge adjacent duplicate words.
|
2020-09-05 16:11:04 +00:00
|
|
|
.endif
|
|
|
|
|
2021-12-18 07:27:22 +00:00
|
|
|
.if ${:L:u} != ""
|
|
|
|
. warning The modifier ':u' must do nothing with an empty word list.
|
2020-09-05 16:11:04 +00:00
|
|
|
.endif
|
|
|
|
|
2021-12-18 07:27:22 +00:00
|
|
|
.if ${ :L:u} != ""
|
2021-06-25 18:16:24 +00:00
|
|
|
. warning The modifier ':u' must normalize the whitespace.
|
|
|
|
.endif
|
|
|
|
|
2021-12-18 07:27:22 +00:00
|
|
|
.if ${word:L:u} != "word"
|
|
|
|
. warning The modifier ':u' must do nothing with a single-element word list.
|
2020-09-05 16:11:04 +00:00
|
|
|
.endif
|
|
|
|
|
2021-12-18 07:27:22 +00:00
|
|
|
.if ${ word :L:u} != "word"
|
2021-06-25 18:16:24 +00:00
|
|
|
. warning The modifier ':u' must normalize the whitespace.
|
|
|
|
.endif
|
|
|
|
|
2021-12-18 07:27:22 +00:00
|
|
|
.if ${1 1 1 1 1 1 1 1:L:u} != "1"
|
|
|
|
. warning The modifier ':u' must merge _all_ adjacent duplicate words.
|
2020-09-05 16:11:04 +00:00
|
|
|
.endif
|
|
|
|
|
2021-12-18 07:27:22 +00:00
|
|
|
.if ${ 1 2 1 1 :L:u} != "1 2 1"
|
|
|
|
. warning The modifier ':u' must normalize whitespace between the words.
|
2020-09-05 16:11:04 +00:00
|
|
|
.endif
|
|
|
|
|
2021-12-18 07:27:22 +00:00
|
|
|
.if ${1 1 1 1 2:L:u} != "1 2"
|
2020-09-05 16:11:04 +00:00
|
|
|
. warning Duplicate words at the beginning must be merged.
|
|
|
|
.endif
|
|
|
|
|
2021-12-18 07:27:22 +00:00
|
|
|
.if ${1 2 2 2 2:L:u} != "1 2"
|
2020-09-05 16:11:04 +00:00
|
|
|
. warning Duplicate words at the end must be merged.
|
|
|
|
.endif
|
|
|
|
|
|
|
|
all:
|