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 6fdd8bd09b - Show all commits
+8
View File
@@ -140,6 +140,7 @@ func TestReadSurveyWalksACellByEveryRoute(t *testing.T) {
func TestReadSurveyReportsAPinClashAsAnError(t *testing.T) { func TestReadSurveyReportsAPinClashAsAnError(t *testing.T) {
fsys := fstest.MapFS{ fsys := fstest.MapFS{
"r.json": {Data: []byte(`"{/y[a].v}"`)}, "r.json": {Data: []byte(`"{/y[a].v}"`)},
"n.json": {Data: []byte(`{"format":"{f}","f":"{/y[a].v}"}`)},
"x.json": {Data: []byte(`{"format":"{v}","rows":"x.tsv","key":"code"}`)}, "x.json": {Data: []byte(`{"format":"{v}","rows":"x.tsv","key":"code"}`)},
"x.tsv": {Data: []byte("code\tv\n1\tb\n2\tc\n")}, "x.tsv": {Data: []byte("code\tv\n1\tb\n2\tc\n")},
"y.json": {Data: []byte(`{"format":"{v}","rows":"y.tsv","key":"code","parent":"x"}`)}, "y.json": {Data: []byte(`{"format":"{v}","rows":"y.tsv","key":"code","parent":"x"}`)},
@@ -159,4 +160,11 @@ func TestReadSurveyReportsAPinClashAsAnError(t *testing.T) {
if err := surveyRender(r).check(); err == nil || !strings.Contains(err.Error(), "two rows of") { if err := surveyRender(r).check(); err == nil || !strings.Contains(err.Error(), "two rows of") {
t.Errorf("check = %v, want y[a]'s row of x clashing with x[2] named, whatever order the fences run in", err) t.Errorf("check = %v, want y[a]'s row of x clashing with x[2] named, whatever order the fences run in", err)
} }
n, isTemplate := g.children["n"].(*template)
if !isTemplate {
t.Fatalf("n is a %T, want a template", g.children["n"])
}
if err := surveyRender(n).check(); err == nil || !strings.HasPrefix(err.Error(), "{f} with {/x[2].v}: x[1] and x[2] are two rows of x") {
t.Errorf("check = %v, want the clash below {f} named by the route the root reaches it by", err)
}
} }