aboutsummaryrefslogtreecommitdiffstats
path: root/docs/superpowers/plans/2026-08-02-qtmaildir-v1.md
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-02 17:53:29 +0200
committerDanilo M. <danix@danix.xyz>2026-08-02 17:53:29 +0200
commit9d7bd35ba32bba04d5241cddee428dba041a6e13 (patch)
tree2072c4580c209379e1ea79b0ece766d22e741150 /docs/superpowers/plans/2026-08-02-qtmaildir-v1.md
parentcb3ab1a1f8bb0a982f4ce7e9e371ed316a77c84c (diff)
downloadqtmaildir-9d7bd35ba32bba04d5241cddee428dba041a6e13.tar.gz
qtmaildir-9d7bd35ba32bba04d5241cddee428dba041a6e13.zip
docs: unit-test NotmuchWorker against a throwaway database
The spec deferred NotmuchWorker to manual verification on the grounds that testing it needs a real notmuch database. Building a fake one in a temporary directory answers that objection, so Task 8 now gets real coverage. This is the only code in the project that writes to a notmuch index, so a bug there corrupts real mail state. It was the wrong place to have the weakest verification. Task 13's manual checklist stays, as confirmation against real data rather than as the only coverage. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'docs/superpowers/plans/2026-08-02-qtmaildir-v1.md')
-rw-r--r--docs/superpowers/plans/2026-08-02-qtmaildir-v1.md18
1 files changed, 15 insertions, 3 deletions
diff --git a/docs/superpowers/plans/2026-08-02-qtmaildir-v1.md b/docs/superpowers/plans/2026-08-02-qtmaildir-v1.md
index b2c3307..1e14105 100644
--- a/docs/superpowers/plans/2026-08-02-qtmaildir-v1.md
+++ b/docs/superpowers/plans/2026-08-02-qtmaildir-v1.md
@@ -2350,9 +2350,21 @@ git commit -S -m "feat: add cross-thread value types and notmuch RAII wrappers"
- Create: `src/notmuchworker.h`, `src/notmuchworker.cpp`
- Modify: `src/CMakeLists.txt`
-Per the spec, `NotmuchWorker` has no unit test: testing it requires a real
-notmuch database. It is verified manually in Task 13. Keep it thin so there is
-little untested logic.
+**Changed 2026-08-02, superseding the spec's "no unit test" position.**
+`NotmuchWorker` IS unit-tested, against a throwaway notmuch database built in
+a temporary directory. The spec deferred this to manual verification on the
+grounds that testing needs a real database; the answer is to build a fake one
+rather than to skip the tests. This matters more than for any other class,
+because `applyTags` is the only code in the project that WRITES to a notmuch
+index, and a bug there corrupts real mail state.
+
+The fixture creates a Maildir tree with a handful of messages, runs
+`notmuch new` against a generated config pointing at it, and sets
+`NOTMUCH_CONFIG` for the test process. Nothing touches the developer's own
+`~/Mail` or `~/.notmuch-config`.
+
+Task 13's manual checklist remains, but as confirmation against real data
+rather than as the only coverage.
- [ ] **Step 1: Write src/notmuchworker.h**