1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 04:10:54 -08:00

Fix ispell-tests on emacs CI

* test/lisp/textmodes/ispell-resources/fake-aspell-new.bash
Error with a broken dictionary.

* test/lisp/textmodes/ispell-tests/ispell-tests-common.el
(ispell-tests--constants/nonexistent-dictionary): Add.
(ispell-tests--some-valid-dictionary): Give fallback dictionary.

* test/lisp/textmodes/ispell-tests/ispell-tests.el
(ispell/ispell-accept-buffer-local-defs/received-file): Use
proper broken dictionary.
This commit is contained in:
Lockywolf 2025-10-19 12:14:58 +02:00 committed by Michael Albinus
parent 6cb8a67e4b
commit 2ae535c90b
3 changed files with 32 additions and 10 deletions

View file

@ -17,6 +17,9 @@ if [[ "$HOME" == '' ]] ; then
exit 3
fi
dictionary=UNSET
repl=UNSET
show_vv()
{
printf '%s\n' "@(#) International Ispell Version 3.1.20 (but really Aspell 0.60.0)"
@ -94,11 +97,24 @@ while :; do
exit
;;
-a) # imitate REPL
imitate_pipe
exit
repl=pipe
;;
-d)
if [ "$2" ]; then
dictionary=$2
if [[ "$dictionary" == "2110001888290146229" ]] ; then exit 3 ; fi
shift
else
printf 'ERROR: "-d" requires an argument.' 1>&2
exit 1
fi
;;
-d*)
dictionary=${1#-d}
if [[ "$dictionary" == "2110001888290146229" ]] ; then exit 3 ; fi
;;
-?*)
printf 'WARN: Unknown option (ignored): %s\n' "$1" >&2
:
;;
*)
break
@ -106,6 +122,11 @@ while :; do
shift
done
printf 'Usage: aspell [options] <command>\n'
if [[ "$repl" == "pipe" ]] ; then
imitate_pipe
else
printf 'Usage: aspell [options] <command>\n'
exit 4
fi
#printf 'this place should be unreachable\n' >> /tmp/lwf_mock-aspell.log

View file

@ -37,15 +37,14 @@
"Path to the mock backend.")
(let* ((backend-binaries (list "ispell" "aspell" "hunspell" "enchant-2" fake-aspell-path)
)
(let* ((backend-binaries (list "ispell" "aspell" "hunspell" "enchant-2" fake-aspell-path))
(filter-binaries (seq-filter
(lambda (b)
(and
(executable-find b)
(equal 0
(with-temp-buffer
(call-process b nil t "-a")))))
(call-process b nil t nil "-a")))))
backend-binaries)))
(defun ispell-tests--some-backend-available-p ()
@ -86,7 +85,8 @@
(forward-line 1)
(let* ((s (buffer-substring (point) (line-end-position))))
(file-name-sans-extension
(file-name-nondirectory s)))))))
(file-name-nondirectory s)))))
(t "english")))
(eval-when-compile
(require 'cl-macs))
@ -140,6 +140,7 @@ its best."
(defconst ispell-tests--constants/russian/correct "привет")
(defconst ispell-tests--constants/russian/wrong "ыфаывфафыввпфыв")
(defconst ispell-tests--constants/completion "waveguides")
(defconst ispell-tests--constants/nonexistent-dictionary "2110001888290146229")
(provide 'ispell-tests-common)

View file

@ -836,14 +836,14 @@ hunspell. Hence skipping."
(ert-deftest ispell/ispell-accept-buffer-local-defs/received-file ()
"Check that `ispell-accept-buffer-local-defs' is broken when a file has a nonexistent file-local dictionary.
We do not control this data, but this should make ispell.el failx."
We do not control this data, but this should make ispell.el fail."
:expected-result :failed
(with-environment-variables (("HOME" temporary-file-directory))
(with-temp-buffer
(ispell-tests--letopt
((ispell-program-name (ispell-tests--some-backend)))
(let ((test-dictname (format "%s" (random))))
(let ((test-dictname ispell-tests--constants/nonexistent-dictionary))
(insert
(car ispell-tests--constants/english/correct-list) "\n\n\n"
ispell-dictionary-keyword test-dictname "\n")