Home | History | Annotate | Download | only in unit-tests

Lines Matching defs:for

1 # $NetBSD: directive-for-escape.mk,v 1.30 2025/06/28 22:39:28 rillig Exp $
3 # Test escaping of special characters in the iteration values of a .for loop.
9 # Even though the .for loops take quotes into account when splitting the
16 # the loop. Not only would it need the escaping for the variable modifier
17 # ':U' but also the escaping for the line-end comment.
18 # expect+3: Unclosed expression, expecting "}" for modifier "U!""
20 .for chars in ${ASCII}
27 # This means that a '#' sign cannot be passed in the value of a .for loop
30 # expect+3: Unclosed expression, expecting "}" for modifier "U!"\\\\"
32 .for chars in ${ASCII.2020-12-31}
40 # was adventurous enough to use literal dollar signs in the values of a .for
41 # loop, allowing this edge case to go unnoticed for years.
43 # See for.c, function ExprLen.
56 .for i in ${VALUES}
68 .for i in $$ $${V} $${V:=-with-modifier} $$(V) $$(V:=-with-modifier)
72 # Try to cover the code for nested '{}' in ExprLen, without success.
79 # The .for loop splits ${VALUES} into 3 words, at the space characters, since
85 # Each of these words is now inserted in the body of the .for loop.
86 .for i in ${VALUES}
90 # When these words are injected into the body of the .for loop, each inside a
93 # expect: For: loop body with i = ${UNDEF:U\$\$:
95 # expect: For: loop body with i = {{}}:
97 # expect: For: loop body with i = end}:
99 # expect: For: end for 1
119 .for i in ${VALUES}
127 # The second attempt to cover the code for nested '{}' in ExprLen.
133 # ':D' for details.) The only sensible thing to do is therefore to let
137 .for i in ${VALUES}
142 # The dollar sign is correctly passed through to the body of the .for loop.
146 .for i in ${:U\$}
150 # Before for.c 1.173 from 2023-05-08, the name of the iteration variable
154 # expect+1: Invalid character ":" in .for loop variable name
155 .for NUMBERS:M*e in replaced
159 # Before for.c 1.173 from 2023-05-08, the name of the iteration variable
164 # expect+1: Invalid character "}" in .for loop variable name
165 .for BASENAME}${EXT in replaced
174 .for i in inner
178 .for i in inner
182 .for i in inner
186 .for i in inner
190 # Before for.c 1.173 from 2023-05-08, the variable name could be a single '$'
195 # expect+1: Invalid character "$" in .for loop variable name
196 .for $ in dollar
200 # Outside a .for loop, '${$}' is interpreted differently. The outer '$' starts
210 # What happens if the values from the .for loop contain a literal newline?
211 # Before for.c 1.144 from 2021-06-25, the newline was passed verbatim to the
212 # body of the .for loop, where it was then interpreted as a literal newline,
216 # The error message occurs in the line of the .for loop since that's the place
217 # where the body of the .for loop is constructed, and at this point the
219 # expect+3: newline in .for value
220 # expect+2: newline in .for value
222 .for i in "${.newline}"
226 .for i in "${.newline}"
229 # Between for.c 1.161 from 2022-01-08 and before for.c 1.163 from 2022-01-09,
230 # a newline character in a .for loop led to a crash since at the point where
231 # the error message including the stack trace is printed, the body of the .for
235 # expect+1: newline in .for value
236 .for i in "${.newline}"
242 .for i in \# \\\#
246 .for i in $$ $$i $$(i) $${i} $$$$ $$$$$$$$ $${:U\$$\$$}
251 # target-local variables. See for.c 1.45 from 2009-01-14.
252 .for i in ${.TARGET} $${.TARGET} $$${.TARGET} $$$${.TARGET}
264 .for i in ((( {{{ ))) }}}
269 # When generating the body of a .for loop, recognizing the expressions is done
272 # same principle applies for other names as well. In this case, the text '$,'
275 .for , in 1