shelltest: detect the ". of empty script" shell problem.
This commit is contained in:
parent
1ed168e79e
commit
32f584cb1c
2 changed files with 10 additions and 0 deletions
2
t/nothing.od
Normal file
2
t/nothing.od
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
# this shell script contains no commands.
|
||||||
|
# it's used for testing the return value of '. ./nothing.od' in shelltest.od.
|
||||||
|
|
@ -280,5 +280,13 @@ lt
|
||||||
[ "$x" = "1" ] || fail 112
|
[ "$x" = "1" ] || fail 112
|
||||||
[ "$y$z" = "67" ] || fail 113
|
[ "$y$z" = "67" ] || fail 113
|
||||||
|
|
||||||
|
# reported by Tim Allen:
|
||||||
|
# some shells don't return 0 from an empty '.' script; they return the
|
||||||
|
# previous command's exit code instead.
|
||||||
|
# See:
|
||||||
|
# http://pubs.opengroup.org/onlinepubs/009695399/utilities/dot.html
|
||||||
|
# http://austingroupbugs.net/view.php?id=114
|
||||||
|
false
|
||||||
|
. ./nothing.od || warn 114
|
||||||
|
|
||||||
exit $FAIL
|
exit $FAIL
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue