Improve checker/fixer cohesion and harden workflows

This commit is contained in:
Julien Bisconti
2026-02-28 01:31:37 +01:00
parent e6e23bf1cf
commit c14a071c8d
12 changed files with 279 additions and 85 deletions

View File

@@ -111,3 +111,23 @@ func TestBuildRealREADME(t *testing.T) {
}
t.Logf("Generated %d bytes", info.Size())
}
func TestBuildFailsWithoutPlaceholder(t *testing.T) {
dir := t.TempDir()
mdPath := filepath.Join(dir, "README.md")
if err := os.WriteFile(mdPath, []byte("# Title\n"), 0o644); err != nil {
t.Fatal(err)
}
tmplPath := filepath.Join(dir, "template.html")
if err := os.WriteFile(tmplPath, []byte("<html><body><main></main></body></html>"), 0o644); err != nil {
t.Fatal(err)
}
outPath := filepath.Join(dir, "index.html")
err := Build(mdPath, tmplPath, outPath)
if err == nil {
t.Fatal("expected Build to fail when template has no supported placeholder")
}
}