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 446a3f98d6 - Show all commits
+20
View File
@@ -2,6 +2,8 @@ package fejkdata
import (
"encoding/json"
"fmt"
"strings"
"testing"
)
@@ -54,3 +56,21 @@ func quote(s string) string {
}
return string(b)
}
type unhandledNode struct{}
func (*unhandledNode) isNode() {}
func TestRenderEdgesPanicsOnAnUnhandledNode(t *testing.T) {
for _, n := range []node{&folder{}, &nullItem{}} {
if es := renderEdges(n); len(es) != 0 {
t.Errorf("renderEdges(%T) = %v, want no edges", n, es)
}
}
defer func() {
if r := recover(); r == nil || !strings.Contains(fmt.Sprint(r), "*fejkdata.unhandledNode") {
t.Errorf("renderEdges(unhandledNode) recovered %v, want a panic naming the node kind", r)
}
}()
renderEdges(&unhandledNode{})
}