MCPcopy Index your code
hub / github.com/devspace-sh/devspace / TestRemoveDirInFileMap

Function TestRemoveDirInFileMap

pkg/devspace/sync/sync_test.go:729–756  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

727}
728
729func TestRemoveDirInFileMap(t *testing.T) {
730 sync := Sync{
731 fileIndex: newFileIndex(),
732 }
733
734 sync.fileIndex.fileMap = map[string]*FileInformation{
735 "/TestDir": {
736 Name: "/TestDir",
737 IsDirectory: true,
738 },
739 "/TestDir/File1": {
740 Name: "/TestDir/File1",
741 Size: 1234,
742 Mtime: 1234,
743 IsDirectory: false,
744 },
745 "/TestDir2": {
746 Name: "/TestDir2",
747 IsDirectory: true,
748 },
749 }
750
751 sync.fileIndex.RemoveDirInFileMap("/TestDir")
752
753 if len(sync.fileIndex.fileMap) != 1 {
754 t.Fatal("Remove dir in file map failed!")
755 }
756}

Callers

nothing calls this directly

Calls 3

newFileIndexFunction · 0.85
RemoveDirInFileMapMethod · 0.80
FatalMethod · 0.45

Tested by

no test coverage detected