From 0637caafff7ec76c2cb77df9584c8e0a30426e96 Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Ollie" Date: Sat, 29 Aug 2026 20:47:38 -0500 Subject: [PATCH] test addTagExclude's Ignored error path Excluding a tag that appears explicitly in the query reports Ignored; other tags still exclude fine. The XapianException path is not externally triggerable since query parsing is lazy. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_017i7R7ReKJAHGQpitxGXqrb --- src/tests.zig | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/tests.zig b/src/tests.zig index 45a446d..93d3efa 100644 --- a/src/tests.zig +++ b/src/tests.zig @@ -418,6 +418,20 @@ test "Query tag exclusion" { try std.testing.expectEqual(fixture.corpus.len - 1, count); } +test "Query tag exclusion error paths" { + var test_db = try fixture.corpusDatabase(); + defer test_db.deinit(); + + const query = try test_db.database.queryCreate("tag:spam"); + defer query.deinit(); + + // Excluding a tag that appears explicitly in the query is ignored. + try std.testing.expectError(error.Ignored, query.addTagExclude("spam")); + + // Other tags can still be excluded. + try query.addTagExclude("other"); +} + test "Message identity, headers, and dates" { var test_db = try fixture.corpusDatabase(); defer test_db.deinit(); -- 2.51.2