echo expect "$@"
}
+# First, a test that bash-2.01.1 fails
+${THIS_SH} ./glob1.sub
+
MYDIR=$PWD # save where we are
TESTDIR=/tmp/glob-test
builtin cd $TESTDIR || { echo $0: cannot cd to $TESTDIR >&2 ; exit 1; }
rm -rf *
-touch a b c d abc abd abe bb bcd ca cb dd de
+touch a b c d abc abd abe bb bcd ca cb dd de Beware
mkdir bdir
# see if `regular' globbing works right
recho a[X-]b
touch .x .y
-expect '<d> <dd> <de>'
+expect '<Beware> <d> <dd> <de>'
recho [^a-c]*
# Make sure that filenames with embedded globbing characters are handled
[]-]) echo ok 35 ;;
esac
+# a backslash should just escape the next character in this context
+case p in
+[a-\z]) echo ok 36 ;;
+esac
+
+# this was a bug in all versions up to bash-2.04-release
+case "/tmp" in
+[/\\]*) echo ok 37 ;;
+esac
+
# none of these should output anything
case abc in
[abc) echo bad 8;;
esac
+# let's start testing the case-insensitive globbing code
+recho b*
+
+shopt -s nocaseglob
+recho b*
+
+recho [b]*
+shopt -u nocaseglob
# make sure set -f works right
set -f
expect '<man/man1/bash.1>'
recho */man*/bash.*
-builtin cd /
-rm -rf $TESTDIR
-
# this is for the benefit of pure coverage, so it writes the pcv file
-# in the right place
+# in the right place, and for gprof
builtin cd $MYDIR
+rm -rf $TESTDIR
+
exit 0