Module Name:    src
Committed By:   rillig
Date:           Sun Nov  1 10:50:22 UTC 2020

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

Log Message:
make(1): precisely describe the expected output in the test moderrs.mk

By making "want:" the same length as "make:", the remaining text in
these lines can be compared easily.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/usr.bin/make/unit-tests/moderrs.exp
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/make/unit-tests/moderrs.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/moderrs.exp
diff -u src/usr.bin/make/unit-tests/moderrs.exp:1.18 src/usr.bin/make/unit-tests/moderrs.exp:1.19
--- src/usr.bin/make/unit-tests/moderrs.exp:1.18	Sun Nov  1 10:46:34 2020
+++ src/usr.bin/make/unit-tests/moderrs.exp	Sun Nov  1 10:50:22 2020
@@ -1,32 +1,33 @@
 modunkn:
-Expect: Unknown modifier 'Z'
+want: Unknown modifier 'Z'
 make: Unknown modifier 'Z'
 VAR:Z=
 
 modunknV:
-Expect: Unknown modifier 'Z'
+want: Unknown modifier 'Z'
 make: Unknown modifier 'Z'
 VAR:Z=
 
 varterm:
-Expect: Unclosed variable specification for VAR
+want: Unclosed variable specification (expecting '}') for "VAR" (value "Thevariable") modifier S
 make: Unclosed variable specification (expecting '}') for "VAR" (value "Thevariable") modifier S
 VAR:S,V,v,=Thevariable
 
 vartermV:
-Expect: Unclosed variable specification for VAR
+want: Unclosed variable specification after complex modifier (expecting '}') for VAR
 make: Unclosed variable specification after complex modifier (expecting '}') for VAR
 VAR:S,V,v,=Thevariable
 
 modtermV:
-Expect: Unfinished modifier for VAR (',' missing)
+want: Unfinished modifier for VAR (',' missing)
 make: Unfinished modifier for VAR (',' missing)
 VAR:S,V,v=
 
 modloop:
-Expect: 2 errors about missing @ delimiter
+want: Unfinished modifier for UNDEF ('@' missing)
 make: Unfinished modifier for UNDEF ('@' missing)
 
+want: Unfinished modifier for UNDEF ('@' missing)
 make: Unfinished modifier for UNDEF ('@' missing)
 
 1 2 3
@@ -37,18 +38,20 @@ make: Unclosed variable specification (e
 1}... 2}... 3}...
 
 modwords:
-Expect: 2 errors about missing ] delimiter
+want: Unfinished modifier for UNDEF (']' missing)
 make: Unfinished modifier for UNDEF (']' missing)
 
+want: Unfinished modifier for UNDEF (']' missing)
 make: Unfinished modifier for UNDEF (']' missing)
 
 13=
 12345=ok
 
 modexclam:
-Expect: 2 errors about missing ! delimiter
+want: Unfinished modifier for VARNAME ('!' missing)
 make: Unfinished modifier for VARNAME ('!' missing)
 
+want: Unfinished modifier for ! ('!' missing)
 make: Unfinished modifier for ! ('!' missing)
 
 

Index: src/usr.bin/make/unit-tests/moderrs.mk
diff -u src/usr.bin/make/unit-tests/moderrs.mk:1.19 src/usr.bin/make/unit-tests/moderrs.mk:1.20
--- src/usr.bin/make/unit-tests/moderrs.mk:1.19	Sun Nov  1 10:46:34 2020
+++ src/usr.bin/make/unit-tests/moderrs.mk	Sun Nov  1 10:50:22 2020
@@ -1,7 +1,8 @@
-# $NetBSD: moderrs.mk,v 1.19 2020/11/01 10:46:34 rillig Exp $
+# $NetBSD: moderrs.mk,v 1.20 2020/11/01 10:50:22 rillig Exp $
 #
 # various modifier error tests
 
+'=		'\''
 VAR=		TheVariable
 # in case we have to change it ;-)
 MOD_UNKN=	Z
@@ -24,28 +25,29 @@ all:	mod-remember-parse
 all:	mod-sysv-parse
 
 modunkn: print-header print-footer
-	@echo "Expect: Unknown modifier 'Z'"
+	@echo 'want: Unknown modifier $'Z$''
 	@echo "VAR:Z=${VAR:Z}"
 
 modunknV: print-header print-footer
-	@echo "Expect: Unknown modifier 'Z'"
+	@echo 'want: Unknown modifier $'Z$''
 	@echo "VAR:${MOD_UNKN}=${VAR:${MOD_UNKN}}"
 
 varterm: print-header print-footer
-	@echo "Expect: Unclosed variable specification for VAR"
+	@echo 'want: Unclosed variable specification (expecting $'}$') for "VAR" (value "Thevariable") modifier S'
 	@echo VAR:S,V,v,=${VAR:S,V,v,
 
 vartermV: print-header print-footer
-	@echo "Expect: Unclosed variable specification for VAR"
+	@echo 'want: Unclosed variable specification after complex modifier (expecting $'}$') for VAR'
 	@echo VAR:${MOD_TERM},=${VAR:${MOD_S}
 
 modtermV: print-header print-footer
-	@echo "Expect: Unfinished modifier for VAR (',' missing)"
+	@echo 'want: Unfinished modifier for VAR ($',$' missing)'
 	-@echo "VAR:${MOD_TERM}=${VAR:${MOD_TERM}}"
 
 modloop: print-header print-footer
-	@echo "Expect: 2 errors about missing @ delimiter"
+	@echo 'want: Unfinished modifier for UNDEF ($'@$' missing)'
 	@echo ${UNDEF:U1 2 3:@var}
+	@echo 'want: Unfinished modifier for UNDEF ($'@$' missing)'
 	@echo ${UNDEF:U1 2 3:@var@...}
 	@echo ${UNDEF:U1 2 3:@var@${var}@}
 
@@ -60,8 +62,9 @@ modloop-close: print-header print-footer
 	@echo ${UNDEF:U1 2 3:@var@${var}}...@}
 
 modwords: print-header print-footer
-	@echo "Expect: 2 errors about missing ] delimiter"
+	@echo 'want: Unfinished modifier for UNDEF ($']$' missing)'
 	@echo ${UNDEF:U1 2 3:[}
+	@echo 'want: Unfinished modifier for UNDEF ($']$' missing)'
 	@echo ${UNDEF:U1 2 3:[#}
 
 	# out of bounds => empty
@@ -81,12 +84,13 @@ modwords: print-header print-footer
 	@echo 12345=${UNDEF:U1 2 3:[123451234512345123451234512345]:S,^$,ok,:S,^3$,ok,}
 
 modexclam: print-header print-footer
-	@echo "Expect: 2 errors about missing ! delimiter"
+	@echo 'want: Unfinished modifier for VARNAME ($'!$' missing)'
 	@echo ${VARNAME:!echo}
 	# When the final exclamation mark is missing, there is no
 	# fallback to the SysV substitution modifier.
 	# If there were a fallback, the output would be "exclam",
 	# and the above would have produced an "Unknown modifier '!'".
+	@echo 'want: Unfinished modifier for ! ($'!$' missing)'
 	@echo ${!:L:!=exclam}
 
 mod-subst-delimiter: print-header print-footer

Reply via email to