2021-01-14 01:24:34 +00:00
|
|
|
# $NetBSD: varmod-to-one-word.mk,v 1.3 2020/12/20 23:29:50 rillig Exp $
|
2020-09-05 16:11:04 +00:00
|
|
|
#
|
|
|
|
# Tests for the :tW variable modifier, which treats the variable value
|
|
|
|
# as a single word, for all following modifiers.
|
|
|
|
|
2021-01-14 01:24:34 +00:00
|
|
|
SENTENCE= The quick brown fox jumps over the lazy brown dog.
|
|
|
|
|
|
|
|
.if ${SENTENCE:tW:[#]} != 1
|
|
|
|
. error
|
|
|
|
.endif
|
|
|
|
.if ${SENTENCE:tw:[#]} != 10
|
|
|
|
. error
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# Protect against accidental freeing of the variable value.
|
|
|
|
.if ${SENTENCE} != "The quick brown fox jumps over the lazy brown dog."
|
|
|
|
. error
|
|
|
|
.endif
|
2020-09-05 16:11:04 +00:00
|
|
|
|
|
|
|
all:
|
|
|
|
@:;
|