shelltest: confirm that 'local' is definitely available.
Supposedly it's not POSIX, but every shell I have seems to support it, so let's just reject any that don't. And like magic, anybody using redo can now count on the 'local' builtin working.
This commit is contained in:
parent
5dbbfd4288
commit
474f2e71fe
1 changed files with 11 additions and 0 deletions
|
|
@ -270,4 +270,15 @@ rm -f || fail 110
|
||||||
rmdir 'space home dir'
|
rmdir 'space home dir'
|
||||||
) || warn 111
|
) || warn 111
|
||||||
|
|
||||||
|
# reported by Alex Bradbury:
|
||||||
|
# http://www.debian.org/doc/debian-policy/ch-files.html#s-scripts
|
||||||
|
# Debian says that 'local' isn't POSIX, but I like it, so let's reject
|
||||||
|
# any shell where it doesn't exist.
|
||||||
|
x=5 y=6 z=7
|
||||||
|
lt() { x=1; local y=2 z=3; }
|
||||||
|
lt
|
||||||
|
[ "$x" = "1" ] || fail 112
|
||||||
|
[ "$y$z" = "67" ] || fail 113
|
||||||
|
|
||||||
|
|
||||||
exit $FAIL
|
exit $FAIL
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue