Use $(( rather than $[ for arithmetic in expand.test.

I can't find any reference to $[ for arithmetic on the bash man page, but it
seems to be a synonym for $((. mksh doesn't support this, so the expand tests
that use it fail on Android. No other toybox tests are using $[.
This commit is contained in:
Elliott Hughes 2017-04-15 11:27:18 -07:00 committed by Rob Landley
parent 151ac30a9f
commit 8d826bf449

View File

@ -20,10 +20,10 @@ TABSTOP=1
BIGTAB=" "
for i in $(seq $POW); do
BIGTAB=$BIGTAB$BIGTAB
TABSTOP=$[$TABSTOP*2]
TABSTOP=$(($TABSTOP*2))
done
testing "long tab single" "expand -t $TABSTOP input" "${BIGTAB}foo\n" "\tfoo\n" ""
testing "long tab tablist" "expand -t $TABSTOP,$[TABSTOP+5] input" \
testing "long tab tablist" "expand -t $TABSTOP,$((TABSTOP+5)) input" \
"${BIGTAB}foo bar\n" "\tfoo\tbar\n" ""
testing "multiline single" "expand -t 4 input" "foo \n bar\n" "foo\t\n\tbar\n" ""