aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias EngdegÄrd2025-09-13 16:32:32 +0200
committerMattias EngdegÄrd2025-09-14 12:40:09 +0200
commitcb17a8bbf3989c0ebbebca0310dc7009f3442df7 (patch)
tree4b2c8bd87289b7cf6c709a2d9f442d89d44aa5c5
parent01e7d537b00bec79a3e0d65ee91da0549621e1a3 (diff)
downloademacs-cb17a8bbf3989c0ebbebca0310dc7009f3442df7.tar.gz
emacs-cb17a8bbf3989c0ebbebca0310dc7009f3442df7.zip
Use linear arrays in ispell test to work with old bash
* test/lisp/textmodes/ispell-resources/fake-aspell-new.bash: Avoid using associative arrays since they are not available in old bash versions that come with some systems (bug#79177).
-rwxr-xr-xtest/lisp/textmodes/ispell-resources/fake-aspell-new.bash14
1 files changed, 11 insertions, 3 deletions
diff --git a/test/lisp/textmodes/ispell-resources/fake-aspell-new.bash b/test/lisp/textmodes/ispell-resources/fake-aspell-new.bash
index 1eb004f6ba6..dec4f2d1667 100755
--- a/test/lisp/textmodes/ispell-resources/fake-aspell-new.bash
+++ b/test/lisp/textmodes/ispell-resources/fake-aspell-new.bash
@@ -22,10 +22,18 @@ show_vv()
22 printf '%s\n' "@(#) International Ispell Version 3.1.20 (but really Aspell 0.60.0)" 22 printf '%s\n' "@(#) International Ispell Version 3.1.20 (but really Aspell 0.60.0)"
23} 23}
24 24
25in_dict()
26{
27 local x=$1
28 for y in ${sessiondict[@]}; do
29 if [ $y = $x ]; then return 0; fi
30 done
31 return 1
32}
33
25imitate_pipe() 34imitate_pipe()
26{ 35{
27 local a 36 local a
28 declare -A sessiondict
29 show_vv 37 show_vv
30 while read a ; do 38 while read a ; do
31 #printf 'pipe="%s"\n' "$a" >> /tmp/lwf_mock-aspell.log 39 #printf 'pipe="%s"\n' "$a" >> /tmp/lwf_mock-aspell.log
@@ -34,13 +42,13 @@ imitate_pipe()
34 elif [[ "$a" == '+' || "$a" == '~nroff' || "$a" == '~tex' || "$a" == '!' || "$a" == '-' || "$a" == '%' ]] ; then 42 elif [[ "$a" == '+' || "$a" == '~nroff' || "$a" == '~tex' || "$a" == '!' || "$a" == '-' || "$a" == '%' ]] ; then
35 printf '' 43 printf ''
36 elif [[ "${a:0:1}" == '@' ]] ; then 44 elif [[ "${a:0:1}" == '@' ]] ; then
37 sessiondict["${a:1}"]="true" 45 sessiondict+=("${a:1}")
38 printf '' 46 printf ''
39 else 47 else
40 for b in $a ; do 48 for b in $a ; do
41 if [[ "$b" == '^' ]] ; then 49 if [[ "$b" == '^' ]] ; then
42 printf '' 50 printf ''
43 elif [[ ${sessiondict[$b]} == 'true' || ${sessiondict[${b#^}]} == 'true' ]] ; then 51 elif in_dict "$b" || in_dict "${b#^}" ; then
44 printf '*\n' 52 printf '*\n'
45 elif [[ "$b" == '^tarampampamtararam' || "$b" == 'tarampampamtararam' ]] ; then 53 elif [[ "$b" == '^tarampampamtararam' || "$b" == 'tarampampamtararam' ]] ; then
46 printf '# tarampampamtararam 0\n' # wrong word 54 printf '# tarampampamtararam 0\n' # wrong word