diff options
Diffstat (limited to 'contrib/bmake/unit-tests/directive-for.mk')
-rwxr-xr-x | contrib/bmake/unit-tests/directive-for.mk | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/contrib/bmake/unit-tests/directive-for.mk b/contrib/bmake/unit-tests/directive-for.mk index 2f989f54f228..72ffaa142ad6 100755 --- a/contrib/bmake/unit-tests/directive-for.mk +++ b/contrib/bmake/unit-tests/directive-for.mk @@ -1,4 +1,4 @@ -# $NetBSD: directive-for.mk,v 1.30 2025/03/30 16:43:10 rillig Exp $ +# $NetBSD: directive-for.mk,v 1.32 2025/07/01 04:24:20 rillig Exp $ # # Tests for the .for directive. # @@ -162,14 +162,14 @@ EXPANSION${plus}= value # except for whitespace, allowing for creative side effects, as usual for # arbitrary code injection. var= outer -# expect+1: invalid character ':' in .for loop variable name +# expect+1: Invalid character ":" in .for loop variable name .for var:Q in value "quoted" . info <${var}> <${var:Q}> <${var:Q:Q}> .endfor # Before 2023-05-09, when variable names could contain '$', the short # expression '$$' was preserved, the long expressions were substituted. -# expect+1: invalid character '$' in .for loop variable name +# expect+1: Invalid character "$" in .for loop variable name .for $ in value . info <$$> <${$}> <$($)> .endfor @@ -181,7 +181,7 @@ var= outer # possibility, therefore the variable names are restricted to using harmless # characters only. INDIRECT= direct -# expect+1: invalid character '$' in .for loop variable name +# expect+1: Invalid character "$" in .for loop variable name .for $(INDIRECT) in value # If the variable name could be chosen dynamically, the iteration variable # might have been 'direct', thereby expanding the expression '${direct}'. @@ -204,7 +204,8 @@ INDIRECT= ${DIRECT} # An empty list of variables to the left of the 'in' is a parse error. -.for in value # expect+0: no iteration variables in for +# expect+1: Missing iteration variables in .for loop +.for in value . error .endfor @@ -230,7 +231,8 @@ INDIRECT= ${DIRECT} # is processed. .for var in value . if 0 -.endfor # expect+0: 1 open conditional +.endfor +# expect-1: 1 open conditional # If there are no iteration values, the loop body is not processed, and the # check for mismatched conditionals is not performed. @@ -246,8 +248,10 @@ INDIRECT= ${DIRECT} .if 0 . for var in value # does not need a corresponding .endfor .endif -.endfor # expect+0: for-less endfor -.endif # expect+0: if-less endif +# expect+1: for-less endfor +.endfor +# expect+1: if-less endif +.endif # When a .for without the corresponding .endfor occurs in an active branch of @@ -255,7 +259,8 @@ INDIRECT= ${DIRECT} # without looking at any other directives. .if 1 . for var in value -. endif # expect+0: if-less endif +# expect+1: if-less endif +. endif . endfor # no 'for-less endfor' .endif # no 'if-less endif' |