(t *testing.T)
| 727 | } |
| 728 | |
| 729 | func 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 | } |
nothing calls this directly
no test coverage detected