1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
package main
import (
"os"
"strings"
"testing"
"mm/internal/config"
)
// Every built-in tool has its own section in the tools reference, in both
// languages — `plan` went without one for months, documented only in a
// how-to.
func TestEveryBuiltinToolHasAReferenceSection(t *testing.T) {
for _, page := range []string{"docs/en/reference/tools.md", "docs/fr/reference/tools.md"} {
data, err := os.ReadFile(page)
if err != nil {
t.Fatal(err)
}
for _, name := range config.BuiltinToolNames {
if !strings.Contains(string(data), "\n## `"+name+"`\n") {
t.Errorf("%s has no \"## `%s`\" section", page, name)
}
}
}
}
|