MCPcopy
hub / github.com/wagoodman/dive / TestAddWhiteoutPath

Function TestAddWhiteoutPath

dive/filetree/file_tree_test.go:209–231  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

207}
208
209func TestAddWhiteoutPath(t *testing.T) {
210 tree := NewFileTree()
211 node, _, err := tree.AddPath("usr/local/lib/python3.7/site-packages/pip/.wh..wh..opq", FileInfo{})
212 if err != nil {
213 t.Errorf("expected no error but got: %v", err)
214 }
215 if node != nil {
216 t.Errorf("expected node to be nil, but got: %v", node)
217 }
218 expected :=
219 `└── usr
220 └── local
221 └── lib
222 └── python3.7
223 └── site-packages
224 └── pip
225`
226 actual := tree.String(false)
227
228 if expected != actual {
229 t.Errorf("Expected tree string:\n--->%s<---\nGot:\n--->%s<---", expected, actual)
230 }
231}
232
233func TestRemovePath(t *testing.T) {
234 tree := NewFileTree()

Callers

nothing calls this directly

Calls 3

AddPathMethod · 0.95
StringMethod · 0.95
NewFileTreeFunction · 0.85

Tested by

no test coverage detected