<feed xmlns='http://www.w3.org/2005/Atom'>
<title>gloss/tests/test-gloss--stats-text.el, branch main</title>
<subtitle>Emacs glossary lookup with Wiktionary fallback
</subtitle>
<id>https://git.cjennings.net/gloss/atom?h=main</id>
<link rel='self' href='https://git.cjennings.net/gloss/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/gloss/'/>
<updated>2026-04-30T06:11:27+00:00</updated>
<entry>
<title>feat: implement gloss secondary commands</title>
<updated>2026-04-30T06:11:27+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-04-30T06:11:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/gloss/commit/?id=5c7bb207081278e41122e62d8f6c282a18574665'/>
<id>urn:sha1:5c7bb207081278e41122e62d8f6c282a18574665</id>
<content type='text'>
Five interactive commands plus the supporting major mode and pure
helpers for `gloss-add'.

`gloss-add' opens a `*gloss-add: TERM*' buffer in `gloss-add-mode',
a `text-mode' derivative with C-c C-c to save and C-c C-k to abort.
The pure save side, `gloss--add-finish-internal', validates term and
body, trims trailing whitespace, and delegates to `gloss-core-save'
with source `manual' before showing the new entry.

`gloss-edit' resolves a term to its source-buffer marker, jumps point
there, unfolds the entry under both the legacy `org-show-entry' and
the post-9.6 `org-fold-show-entry' (with-no-warnings on the fallback),
and installs `gloss--after-save-refresh-cache' as a buffer-local
after-save hook so manual edits keep the cache honest.

`gloss-list-terms' prompts via `completing-read' over
`gloss-core-list' and dispatches the chosen term to
`gloss--lookup-flow'. Empty glossary raises a user-error.

`gloss-stats' formats a multi-line report (total / by-source /
drill-tagged / file size / cache mtime) via the pure helper
`gloss--stats-text' and shows it in `*gloss-stats*' under
`special-mode'. Drill counting walks the file via `org-map-entries'
to be safe against tag-substring false positives.

`gloss-reload' is a thin wrapper that resets the in-memory cache and
re-ensures it from disk.

`gloss-drill-export' is a thin wrapper around
`gloss-drill-export-all'.

Audit fold-in: renamed the stats-text missing-file test from
`-reports-zero-and-never' to `-reports-zero' to match what the
assertion actually checks (the file is auto-created on first call,
so mtime is set, not "never").

Filed as a v1.1 follow-up: `gloss.el' reaches into
`gloss-core--cache-reset' and `gloss-core--cache-ensure'
double-dash-private functions. Decide whether to treat double-dash as
"package-private" idiom or to expose public aliases.

125 tests pass in 0.25s — 111 prior plus 14 new across the six new
files. No byte-compile warnings.
</content>
</entry>
<entry>
<title>test: add gloss secondary commands test suite (red phase)</title>
<updated>2026-04-30T06:07:44+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-04-30T06:07:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/gloss/commit/?id=d313c37f14511564849c70c564c14ca51bd4ae7c'/>
<id>urn:sha1:d313c37f14511564849c70c564c14ca51bd4ae7c</id>
<content type='text'>
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.
</content>
</entry>
</feed>
