Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/make/unit-tests make(1): precisely describe the expe...
details: https://anonhg.NetBSD.org/src/rev/c5a1506161d9
branches: trunk
changeset: 941880:c5a1506161d9
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Nov 01 10:50:22 2020 +0000
description:
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.
diffstat:
usr.bin/make/unit-tests/moderrs.exp | 19 +++++++++++--------
usr.bin/make/unit-tests/moderrs.mk | 22 +++++++++++++---------
2 files changed, 24 insertions(+), 17 deletions(-)
diffs (141 lines):
diff -r a4e407c91ffd -r c5a1506161d9 usr.bin/make/unit-tests/moderrs.exp
--- a/usr.bin/make/unit-tests/moderrs.exp Sun Nov 01 10:46:34 2020 +0000
+++ b/usr.bin/make/unit-tests/moderrs.exp Sun Nov 01 10:50:22 2020 +0000
@@ -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 @@
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)
diff -r a4e407c91ffd -r c5a1506161d9 usr.bin/make/unit-tests/moderrs.mk
--- a/usr.bin/make/unit-tests/moderrs.mk Sun Nov 01 10:46:34 2020 +0000
+++ b/usr.bin/make/unit-tests/moderrs.mk Sun Nov 01 10:50:22 2020 +0000
@@ -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-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 @@
@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 @@
@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
Home |
Main Index |
Thread Index |
Old Index