diff options
| author | Craig Jennings <c@cjennings.net> | 2026-04-30 01:07:44 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-04-30 01:07:44 -0500 |
| commit | d313c37f14511564849c70c564c14ca51bd4ae7c (patch) | |
| tree | 315a0bf268c937f406e3060f07325dae9378152c /tests/test-gloss--drill-export-smoke.el | |
| parent | eefd55510cf6b180a7dcc9be40fde894d9adf3ac (diff) | |
| download | gloss-d313c37f14511564849c70c564c14ca51bd4ae7c.tar.gz gloss-d313c37f14511564849c70c564c14ca51bd4ae7c.zip | |
test: add gloss secondary commands test suite (red phase)
Six test files for the remaining stub commands. All 14 tests fail at
this commit because the implementations are stubs.
`gloss--add-finish-internal' (the pure save side of `gloss-add') gets
N/B/E coverage on validation and the persistence side effect.
`gloss--stats-text' (the pure stats string formatter) covers empty,
populated, and missing-file cases. The interactive commands
(`gloss-edit', `gloss-list-terms', `gloss-reload', `gloss-drill-export')
get smoke tests only — the design treats them as mode-glue with 70%
coverage targets, since prompts and `switch-to-buffer' are framework
behaviour Emacs already tests.
Two error-path tests assert the message contains a specific substring,
not just that `user-error' was raised. The stubs raise `user-error' too,
so a bare `should-error' would pass for the wrong reason. The substring
check anchors red against the real error path.
Diffstat (limited to 'tests/test-gloss--drill-export-smoke.el')
| -rw-r--r-- | tests/test-gloss--drill-export-smoke.el | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/test-gloss--drill-export-smoke.el b/tests/test-gloss--drill-export-smoke.el new file mode 100644 index 0000000..55b83e8 --- /dev/null +++ b/tests/test-gloss--drill-export-smoke.el @@ -0,0 +1,32 @@ +;;; test-gloss--drill-export-smoke.el --- Smoke test for gloss-drill-export -*- lexical-binding: t -*- + +;; SPDX-License-Identifier: GPL-3.0-or-later + +;;; Commentary: +;; Smoke test confirming `gloss-drill-export' is a thin wrapper around +;; `gloss-drill-export-all' and runs end-to-end against a real glossary. + +;;; Code: + +(require 'ert) +(require 'gloss) +(require 'testutil-gloss) +(require 'testutil-gloss-drill) + +(ert-deftest test-gloss-drill-export-tags-every-entry () + "Smoke: drill-export delegates and tags every entry with :drill:." + (gloss-test--with-temp-glossary gloss-test--sample-content + (gloss-test--with-org-drill-feature + (gloss-drill-export) + (with-current-buffer (find-file-noselect gloss-file) + (revert-buffer t t t) + (let ((tagged 0)) + (org-map-entries + (lambda () + (when (and (= 1 (org-current-level)) + (member "drill" (org-get-tags nil t))) + (setq tagged (1+ tagged))))) + (should (= tagged 2))))))) + +(provide 'test-gloss--drill-export-smoke) +;;; test-gloss--drill-export-smoke.el ends here |
