Finish the D&D module cleanup

This commit is contained in:
2026-07-25 13:30:23 +00:00
parent aeaaf44ae0
commit 29ee68824d
14 changed files with 76 additions and 366 deletions

View File

@@ -334,6 +334,9 @@ func TestDocumentIndexSnapshotsIdentityAndUnitPositions(t *testing.T) {
doc.ID = "changed"
doc.Units[0].ID = 99
if documentID, ok := index.DocumentID(); !ok || documentID != "source-1" {
t.Fatalf("DocumentID() = %q, %t, want source-1, true", documentID, ok)
}
if position, ok := index.Position(30); !ok || position != 0 {
t.Fatalf("Position(30) = %d, %t, want 0, true", position, ok)
}
@@ -348,6 +351,9 @@ func TestDocumentIndexSnapshotsIdentityAndUnitPositions(t *testing.T) {
func TestZeroDocumentIndexIsSafe(t *testing.T) {
var index DocumentIndex
if documentID, ok := index.DocumentID(); ok || documentID != "" {
t.Fatalf("DocumentID() = %q, %t, want empty, false", documentID, ok)
}
if position, ok := index.Position(1); ok || position != 0 {
t.Fatalf("Position(1) = %d, %t, want 0, false", position, ok)
}