xref: /freebsd/contrib/bmake/unit-tests/varmod-match.mk (revision 96474d2a3fa895fb9636183403fc8ca7ccf60216)
1# $NetBSD: varmod-match.mk,v 1.3 2020/08/16 20:03:53 rillig Exp $
2#
3# Tests for the :M variable modifier, which filters words that match the
4# given pattern.
5
6all: match-char-class
7all: slow
8
9
10NUMBERS=	One Two Three Four five six seven
11
12match-char-class:
13	@echo '$@:'
14	@echo '  uppercase numbers: ${NUMBERS:M[A-Z]*}'
15	@echo '  all the others: ${NUMBERS:M[^A-Z]*}'
16	@echo '  starts with non-s, ends with [ex]: ${NUMBERS:M[^s]*[ex]}'
17
18
19# Before 2020-06-13, this expression took quite a long time in Str_Match,
20# calling itself 601080390 times for 16 asterisks.
21slow:
22	@: ${:U****************:M****************b}
23