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 b726edd7cb - Show all commits
+16
View File
@@ -344,3 +344,19 @@ func TestAFreshReadInsideANamedPickSharesNoValueWithIt(t *testing.T) {
} }
} }
} }
func TestEveryReadKeysEachLevelFromItsHeadToItsLeaf(t *testing.T) {
root := compiled(t, `{"format":"{place.geo as g}{g.town.zip} {g.town} {x.y.z}","place":{"format":"{geo}","geo":{"format":"{town}","town":{"format":"{zip}","zip":"1"}}},"x":{"format":"{y}","y":{"format":"{z}","z":"2"}}}`).(*template)
want := map[string]string{
"g.town.zip": "[ geo geo.town geo.town.zip]",
"g.town": "[ geo geo.town]",
"x.y.z": "[x x.y x.y.z]",
}
for _, o := range root.compiled.ops {
for _, a := range o.arms {
if got := fmt.Sprint(a.levels); got != want[a.spelling] {
t.Errorf("{%s} keys its levels %s, want %s", a.spelling, got, want[a.spelling])
}
}
}
}