(t *testing.T)
| 1146 | } |
| 1147 | |
| 1148 | func TestPullTempFileCaseConflict(t *testing.T) { |
| 1149 | _, f := setupSendReceiveFolder(t) |
| 1150 | |
| 1151 | copyChan := make(chan copyBlocksState, 1) |
| 1152 | |
| 1153 | file := protocol.FileInfo{Name: "foo"} |
| 1154 | confl := "Foo" |
| 1155 | tempNameConfl := fs.TempName(confl) |
| 1156 | if fd, err := f.mtimefs.Create(tempNameConfl); err != nil { |
| 1157 | t.Fatal(err) |
| 1158 | } else { |
| 1159 | if _, err := fd.Write([]byte("data")); err != nil { |
| 1160 | t.Fatal(err) |
| 1161 | } |
| 1162 | fd.Close() |
| 1163 | } |
| 1164 | |
| 1165 | f.handleFile(t.Context(), file, copyChan) |
| 1166 | |
| 1167 | cs := <-copyChan |
| 1168 | if _, err := cs.tempFile(); err != nil { |
| 1169 | t.Error(err) |
| 1170 | } else { |
| 1171 | cs.finalClose() |
| 1172 | } |
| 1173 | } |
| 1174 | |
| 1175 | func TestPullCaseOnlyRename(t *testing.T) { |
| 1176 | m, f := setupSendReceiveFolder(t) |
nothing calls this directly
no test coverage detected