From 474f2e71fe81cf2976c789f21c45253f62342ffd Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Mon, 17 Jan 2011 23:20:27 -0800 Subject: [PATCH] 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. --- t/shelltest.od | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/t/shelltest.od b/t/shelltest.od index d5eda7f..72b4b70 100644 --- a/t/shelltest.od +++ b/t/shelltest.od @@ -270,4 +270,15 @@ rm -f || fail 110 rmdir 'space home dir' ) || 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