Make great documentation goal 1.2, and plan the README's reorganisation and the nested-template gaps #33

Open
lilleman wants to merge 966 commits from worktree-todo-relative-dates-exact-counts into main
Showing only changes of commit dda470dc9c - Show all commits
+7 -4
View File
@@ -133,12 +133,15 @@ func receiverType(recv *ast.FieldList) string {
const fillHeader = "Filled by " const fillHeader = "Filled by "
// TestTemplateFieldsNameTheirPass holds a renamed pass to the group it fills. // TestTemplateFieldGroupsNameADeclaredPass holds a renamed pass to the group it
func TestTemplateFieldsNameTheirPass(t *testing.T) { // fills, and to the template doc.
func TestTemplateFieldGroupsNameADeclaredPass(t *testing.T) {
fset, files := sourceFiles(t) fset, files := sourceFiles(t)
declared := declaredSymbols(files) declared := declaredSymbols(files)
doc, st, headers := templateStruct(t, fset, files) doc, st, headers := templateStruct(t, fset, files)
namesDeclared(t, "the template doc", doc, declared) if namesDeclared(t, "the template doc", doc, declared) == 0 {
t.Error("the template doc names no pass, so nothing says when a field is final")
}
for _, field := range st.Fields.List { for _, field := range st.Fields.List {
if len(field.Names) == 0 { if len(field.Names) == 0 {
t.Error("an embedded field of template sits under no header, so nothing says which pass fills it") t.Error("an embedded field of template sits under no header, so nothing says which pass fills it")
@@ -150,7 +153,7 @@ func TestTemplateFieldsNameTheirPass(t *testing.T) {
continue continue
} }
if namesDeclared(t, "the header above template."+id.Name, header, declared) == 0 { if namesDeclared(t, "the header above template."+id.Name, header, declared) == 0 {
t.Errorf("the header above template.%s names no function, so it names no pass", id.Name) t.Errorf("the header above template.%s names no symbol, so it names no pass", id.Name)
} }
} }
} }