summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/assoc.right1
-rw-r--r--tests/assoc9.sub7
-rw-r--r--tests/casemod.right2
-rw-r--r--tests/casemod.tests4
-rw-r--r--tests/glob.right4
-rw-r--r--tests/glob.tests1
-rw-r--r--tests/glob9.sub13
-rw-r--r--tests/history5.sub6
8 files changed, 31 insertions, 7 deletions
diff --git a/tests/assoc.right b/tests/assoc.right
index d176bcd4..e9aa9172 100644
--- a/tests/assoc.right
+++ b/tests/assoc.right
@@ -222,6 +222,7 @@ declare -A a=(["80's"]="Depeche Mode" )
1+5
declare -A a=(["\$(date >&2)"]="5" )
declare -A myarray=([foo]="bleh" ["foo[bar"]="bleh" )
+foo
./assoc10.sub: line 14: declare: a: cannot convert indexed to associative array
f: declare -a a
./assoc10.sub: line 17: declare: a: cannot convert associative to indexed array
diff --git a/tests/assoc9.sub b/tests/assoc9.sub
index 8f2a23be..b8867187 100644
--- a/tests/assoc9.sub
+++ b/tests/assoc9.sub
@@ -121,3 +121,10 @@ declare myarray["foo[bar"]=bleh
myarray["foo"]=bleh
declare -p myarray
+
+key='$(date >&2)'
+declare -A aa
+aa[$key]=foo
+echo "${aa[$key]}"
+
+[[ -v aa[$key] ]] || echo bad assoc expansion
diff --git a/tests/casemod.right b/tests/casemod.right
index a5840171..df124754 100644
--- a/tests/casemod.right
+++ b/tests/casemod.right
@@ -43,7 +43,5 @@ Be Conservative in what you send and Liberal in what you accept
BE CONSERVATIVE IN WHAT YOU SEND AND LIBERAL IN WHAT YOU ACCEPT
Be conservative in what you send and liberal in what you accept
BE CONSERVATIVE IN WHAT YOU SEND AND LIBERAL IN WHAT YOU ACCEPT
-AcknOwlEdgEmEnt acknOwlEdgEmEnt
-oeNoPHiLe OEnOphIlE
abcdexyz
ABCDEXYZ
diff --git a/tests/casemod.tests b/tests/casemod.tests
index 20cb1cf5..56ab20d9 100644
--- a/tests/casemod.tests
+++ b/tests/casemod.tests
@@ -114,8 +114,8 @@ echo ${TEXT2^^}
M1=${S1^^[aeiou]}
M2=${U2,,[AEIOU]}
-echo ${M1} ${M1~}
-echo ${M2} ${M2~~}
+#echo ${M1} ${M1~}
+#echo ${M2} ${M2~~}
declare -l lower=aBcDe
lower+=XyZ
diff --git a/tests/glob.right b/tests/glob.right
index 8ba1acfe..94966905 100644
--- a/tests/glob.right
+++ b/tests/glob.right
@@ -119,6 +119,8 @@ searchable/.
6:
a\*b
a\*b*
+é/*
+é/*
argv[1] = <a>
argv[2] = <abc>
argv[3] = <abd>
@@ -133,7 +135,7 @@ argv[2] = <abc>
argv[3] = <abd>
argv[4] = <abe>
tmp/l1 tmp/l2 tmp/*4 tmp/l3
-./glob.tests: line 64: no match: tmp/*4
+./glob.tests: line 65: no match: tmp/*4
argv[1] = <bdir/>
argv[1] = <*>
argv[1] = <a*>
diff --git a/tests/glob.tests b/tests/glob.tests
index 9005e4de..b35d7336 100644
--- a/tests/glob.tests
+++ b/tests/glob.tests
@@ -29,6 +29,7 @@ ${THIS_SH} ./glob5.sub
${THIS_SH} ./glob6.sub
${THIS_SH} ./glob7.sub
${THIS_SH} ./glob8.sub
+${THIS_SH} ./glob9.sub
MYDIR=$PWD # save where we are
diff --git a/tests/glob9.sub b/tests/glob9.sub
new file mode 100644
index 00000000..ef2af2bd
--- /dev/null
+++ b/tests/glob9.sub
@@ -0,0 +1,13 @@
+LANG=en_US.UTF-8 # safest
+: ${TMPDIR:=/var/tmp}
+HOME=${TMPDIR}
+
+mkdir ~/ಇಳಿಕೆಗಳು
+touch ~/ಇಳಿಕೆಗಳು/{a,b}.txt
+echo ~/ಇಳಿಕೆಗಳು/*.txt >/dev/null
+
+rm -rf ${TMPDIR}/ಇಳಿಕೆಗಳು
+
+LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
+echo é/*
+echo 'é'/*
diff --git a/tests/history5.sub b/tests/history5.sub
index c44ace8a..245c28d0 100644
--- a/tests/history5.sub
+++ b/tests/history5.sub
@@ -12,9 +12,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-trap 'rm -f $HISTFILE' 0 1 2 3 6 15
+trap 'rm -f "$OUT"' 0 1 2 3 6 15
-HISTFILE=$TMPDIR/fchist-$$
+HISTFILE=$TMPDIR/fchist-$$ ; OUT=$HISTFILE
unset HISTIGNORE HISTCONTROL
set -o history
@@ -53,3 +53,5 @@ fc -l 1 99
# other out-of-range behavior for future work
echo out of range 4
fc -l -20 -40
+
+unset HISTFILE # suppress writing history file