Module Name:    src
Committed By:   rillig
Date:           Sun Mar 14 16:00:07 UTC 2021

Modified Files:
        src/usr.bin/make/unit-tests: modword.exp modword.mk

Log Message:
make: add test for edge case in modifier ':[...]'

TryParseIntBase0 wrongly returns successful for a string that does not
start with a number at all.  Its only caller, ApplyModifier_Words,
already handles all error cases properly.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/modword.exp
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/modword.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/unit-tests/modword.exp
diff -u src/usr.bin/make/unit-tests/modword.exp:1.3 src/usr.bin/make/unit-tests/modword.exp:1.4
--- src/usr.bin/make/unit-tests/modword.exp:1.3	Tue Feb 23 16:07:14 2021
+++ src/usr.bin/make/unit-tests/modword.exp	Sun Mar 14 16:00:07 2021
@@ -71,6 +71,8 @@ make: Bad modifier ":[1.]" for variable 
 LIST:[1.]="" is an error
 make: Bad modifier ":[1..]" for variable "LIST"
 LIST:[1..]="" is an error
+make: Bad modifier ":[1.. ]" for variable "LIST"
+LIST:[1.. ]="" is an error
 LIST:[1..1]="one"
 make: Bad modifier ":[1..1.]" for variable "LIST"
 LIST:[1..1.]="" is an error

Index: src/usr.bin/make/unit-tests/modword.mk
diff -u src/usr.bin/make/unit-tests/modword.mk:1.5 src/usr.bin/make/unit-tests/modword.mk:1.6
--- src/usr.bin/make/unit-tests/modword.mk:1.5	Sun Nov 15 20:20:58 2020
+++ src/usr.bin/make/unit-tests/modword.mk	Sun Mar 14 16:00:07 2021
@@ -1,4 +1,4 @@
-# $NetBSD: modword.mk,v 1.5 2020/11/15 20:20:58 rillig Exp $
+# $NetBSD: modword.mk,v 1.6 2021/03/14 16:00:07 rillig Exp $
 #
 # Test behaviour of new :[] modifier
 # TODO: When was this modifier new?
@@ -99,6 +99,7 @@ mod-squarebrackets-n:
 mod-squarebrackets-start-end:
 	@echo 'LIST:[1.]="${LIST:[1.]}" is an error'
 	@echo 'LIST:[1..]="${LIST:[1..]}" is an error'
+	@echo 'LIST:[1.. ]="${LIST:[1.. ]}" is an error'
 	@echo 'LIST:[1..1]="${LIST:[1..1]}"'
 	@echo 'LIST:[1..1.]="${LIST:[1..1.]}" is an error'
 	@echo 'LIST:[1..2]="${LIST:[1..2]}"'

Reply via email to