MCPcopy Create free account
hub / github.com/JordanCoin/codemap / TestBuildTreeStructureDeepNesting

Function TestBuildTreeStructureDeepNesting

render/tree_test.go:56–83  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

54}
55
56func TestBuildTreeStructureDeepNesting(t *testing.T) {
57 files := []scanner.FileInfo{
58 {Path: "a/b/c/d/e/file.go", Size: 100},
59 }
60
61 root := buildTreeStructure(files)
62
63 // Navigate to the file
64 current := root
65 for _, dir := range []string{"a", "b", "c", "d", "e"} {
66 child, ok := current.children[dir]
67 if !ok {
68 t.Errorf("Expected directory %s", dir)
69 return
70 }
71 if child.isFile {
72 t.Errorf("%s should be a directory", dir)
73 }
74 current = child
75 }
76
77 // Check file exists
78 if file, ok := current.children["file.go"]; !ok {
79 t.Error("Expected file.go")
80 } else if !file.isFile {
81 t.Error("file.go should be a file")
82 }
83}
84
85func TestFormatSize(t *testing.T) {
86 tests := []struct {

Callers

nothing calls this directly

Calls 2

buildTreeStructureFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected