From ee32a965d89f642449dac1b5d9c0b9f2a260349e Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Mon, 28 Feb 2011 22:02:06 -0800 Subject: [PATCH] shelltest.od: test that $1/$2/$3 are set correctly in "." scripts. dash seems to fail this one, and it's not pretty. --- t/dotparams.od | 2 ++ t/shelltest.od | 6 ++++++ 2 files changed, 8 insertions(+) create mode 100644 t/dotparams.od diff --git a/t/dotparams.od b/t/dotparams.od new file mode 100644 index 0000000..ab00bf4 --- /dev/null +++ b/t/dotparams.od @@ -0,0 +1,2 @@ +# call this as ". ./dotparams.od a b" from shelltest.od +[ "$1" = a ] && [ "$2" = b ] && [ "$#" = 2 ] || fail 115 diff --git a/t/shelltest.od b/t/shelltest.od index c97fa62..c3ac682 100644 --- a/t/shelltest.od +++ b/t/shelltest.od @@ -289,4 +289,10 @@ lt false . ./nothing.od || warn 114 +# this one seems to be a bug in some versions of dash: the parameters to the +# '.' command must not be ignored. +set x y z +. ./dotparams.od a b || fail 115 +[ "$1-$2-$3" = "x-y-z" ] || fail 116 + exit $FAIL