22
33;;; Commentary:
44
5- ;; Run with:
6- ;; `emacs --batch -Q -L lisp -l ert -l test/ghostel-test.el -f ghostel-test-run'
7- ;;
8- ;; Pure Elisp tests only (no native module):
9- ;; `emacs --batch -Q -L lisp -l ert -l test/ghostel-test.el -f ghostel-test-run-elisp'
5+ ;; Run via `make test' (pure Elisp, no native module required) or
6+ ;; `make test-native' (requires the built native module). See the
7+ ;; Makefile for the underlying Emacs invocation.
108
119;;; Code:
1210
@@ -556,11 +554,11 @@ scrolling libghostty's viewport."
556554 (kill-buffer buf))))
557555
558556(ert-deftest ghostel-test-scrollback-eviction-chunked ()
559- "Scrollback eviction works when writing happens in little chunks with
560- renders in between. Writes a small batch, renders, then writes a large
561- batch across many small writes interspersed with renders. The accumulated
562- scrollback from the second phase must evict the first phase from the
563- Emacs buffer."
557+ "Scrollback eviction works for chunked writes with interleaved renders.
558+ Writes a small batch, renders, then writes a large batch across many
559+ small writes interspersed with renders. The accumulated scrollback
560+ from the second phase must evict the first phase from the Emacs
561+ buffer."
564562 (let ((buf (generate-new-buffer " *ghostel-test-sb-evict*")))
565563 (unwind-protect
566564 (with-current-buffer buf
@@ -581,11 +579,10 @@ Emacs buffer."
581579 (kill-buffer buf))))
582580
583581(ert-deftest ghostel-test-scrollback-eviction-bulk ()
584- "Scrollback eviction works when a single large write pushes all rows
585- out of libghostty's scrollback cap at once. Writes a small batch,
586- renders, then writes a massive amount in one go that gets evicted in
587- one fell swoop. The second redraw must evict the first-batch rows from
588- the Emacs buffer."
582+ "Scrollback eviction works for a single large bulk write.
583+ Writes a small batch, renders, then writes a massive amount in one go
584+ that pushes all rows out of libghostty's scrollback cap at once. The
585+ second redraw must evict the first-batch rows from the Emacs buffer."
589586 (let ((buf (generate-new-buffer " *ghostel-test-sb-evict*")))
590587 (unwind-protect
591588 (with-current-buffer buf
@@ -605,8 +602,10 @@ the Emacs buffer."
605602 (kill-buffer buf))))
606603
607604(ert-deftest ghostel-test-no-stale-lines-in-scrollback ()
608- "Rows that have been materialized in a previous render and are then modified
609- and scrolled out in a single write should not scroll out the stale row."
605+ "Rows modified and scrolled out in one write must not leak stale text.
606+ A row that has been materialized in a previous render and is then
607+ modified and scrolled out in a single write should not scroll out the
608+ stale row."
610609 (let ((buf (generate-new-buffer " *ghostel-test-sb-buffer*")))
611610 (unwind-protect
612611 (with-current-buffer buf
@@ -1239,7 +1238,7 @@ Mirrors the real zsh case where the directory still contains a
12391238;; -----------------------------------------------------------------------
12401239
12411240(ert-deftest ghostel-test-fish-auto-inject-loads-integration ()
1242- "Fish auto-inject shim must chain to etc/shell/ ghostel.fish and clean XDG_DATA_DIRS.
1241+ "Fish auto-inject shim chains to ghostel.fish and cleans XDG_DATA_DIRS.
12431242Regression test: the vendor_conf.d shim previously (a) inlined a
12441243partial copy of the integration and silently dropped the outbound
12451244\\='ssh' wrapper, and (b) used a temp variable name (\\='xdg_data_dirs')
@@ -3925,7 +3924,7 @@ declare that variable buffer-locally so the live buffer qualifies."
39253924;; -----------------------------------------------------------------------
39263925
39273926(ert-deftest ghostel-test-resize-redraw-alt-screen ()
3928- "After resize on alt screen, the app's SIGWINCH-triggered redraw renders correctly.
3927+ "Resize on alt screen: SIGWINCH-triggered redraw renders correctly.
39293928Simulates: alt-screen TUI fills screen → window resize → app redraws
39303929for new size inside BSU/ESU → verify buffer shows new content."
39313930 (let ((buf (generate-new-buffer " *ghostel-test-resize-redraw*")))
@@ -6539,7 +6538,7 @@ rather than the selected window's buffer."
65396538 (should (lookup-key ghostel-mode-map (kbd "C-@"))))
65406539
65416540(ert-deftest ghostel-test-c-g-binding ()
6542- "The quit key is bound to `ghostel- send-C-g' in `ghostel-mode-map' ."
6541+ "`ghostel-mode-map' binds the quit key to a dedicated send handler ."
65436542 (should (eq (lookup-key ghostel-mode-map (kbd "C-g"))
65446543 #'ghostel-send-C-g)))
65456544
@@ -6559,7 +6558,7 @@ rather than the selected window's buffer."
65596558 (kill-buffer buf))))
65606559
65616560(ert-deftest ghostel-test-c-g-deactivates-mark ()
6562- "`ghostel- send-C-g' should clear an active region and `quit-flag'.
6561+ "The quit-key send handler clears an active region and `quit-flag'.
65636562`keyboard-quit' is bypassed because `inhibit-quit' is set, so both
65646563side effects have to happen explicitly inside the command."
65656564 (let ((buf (generate-new-buffer " *ghostel-test-c-g-mark*"))
@@ -7662,9 +7661,10 @@ printf '\\033[H\\033[2J'; exec %s"
76627661 (kill-buffer buf)))))
76637662
76647663(ert-deftest ghostel-test-sigwinch-via-ghostel-resize-handler ()
7665- "SIGWINCH reaches child processes via `ghostel--window-adjust-process-window-size'.
7666- This is the full path Emacs takes: call the adjust-window-size-function,
7667- get (width . height), then call `set-process-window-size'."
7664+ "SIGWINCH reaches child processes via the resize handler.
7665+ Exercises `ghostel--window-adjust-process-window-size', the full
7666+ path Emacs takes: call the adjust-window-size-function, get
7667+ \(width . height), then call `set-process-window-size'."
76687668 (skip-unless (not (eq system-type 'windows-nt)))
76697669 (skip-unless (file-executable-p "/bin/sh"))
76707670 (let* ((buf (generate-new-buffer " *sigwinch-gh-handler*"))
0 commit comments