Prepare shared glossary documents

This commit is contained in:
2026-11-27 16:26:22 +00:00
parent 1bb1daa1f2
commit 28d149f7ed
6 changed files with 104 additions and 24 deletions

View File

@@ -217,6 +217,11 @@ func TestResolvePreparedGlossaryDocuments(t *testing.T) {
if got.Path != file || got.Checksum != checksum || got.Size != int64(len(payload)) || !strings.Contains(got.RelativePath, "inputs/glossaries/") {
t.Fatalf("identity: %+v", got)
}
m.Inputs[0].Size = int64(len(payload)) + 1
if _, err := ResolvePreparedInput(paths, m, source); err == nil || !strings.Contains(err.Error(), "size mismatch") {
t.Fatalf("incorrect declared size: %v", err)
}
m.Inputs[0].Size = 0
if err := os.WriteFile(file, []byte("changed"), 0644); err != nil {
t.Fatal(err)
}