freebsd-src/unit-tests/varmod-unique.mk
Simon J. Gerraty 6bbc783f48 Import bmake-20200902
Lots of code refactoring, simplification and cleanup.
Lots of new unit-tests providing much higher code coverage.
All courtesy of rillig at netbsd.

Other significant changes:

o new read-only variable .SHELL which provides the path of the shell
  used to run scripts (as defined by  the .SHELL target).

o new debug option -dl: LINT mode, does the equivalent of := for all
  variable assignments so that file and line number are reported for
  variable parse errors.
2020-09-05 16:11:04 +00:00

40 lines
987 B
Makefile

# $NetBSD: varmod-unique.mk,v 1.4 2020/08/31 17:41:38 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 ${:U1:u} != "1"
. warning The :u modifier must do nothing with a single-element word list.
.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:
@:;