Skip to content
quarry Artifact [0052df1f7b]
Login

Artifact [0052df1f7b]

Artifact 0052df1f7bf6c5d994996e380434d6043d07aac33753f6752cea3f58dc53aae8:


package api

import (
	"os"
	"testing"

	"craftdesign.group/quarry/internal/ops"
)

// TestDocsCurrent is the documentation exit criterion (0003): docs/api.md
// must match what the registry generates. Regenerate with `make docs`.
func TestDocsCurrent(t *testing.T) {
	r := ops.NewRegistry()
	if err := RegisterAll(r, Deps{Version: "v"}); err != nil {
		t.Fatal(err)
	}
	want := ops.Docs(r, "quarry")
	got, err := os.ReadFile("../../docs/api.md")
	if err != nil {
		t.Fatalf("docs/api.md unreadable (run `make docs`): %v", err)
	}
	if string(got) != string(want) {
		t.Fatal("docs/api.md is stale — run `make docs` and commit the result")
	}
}