(t *testing.T)
| 950 | } |
| 951 | |
| 952 | func TestMoveFile(t *testing.T) { |
| 953 | ctx := context.Background() |
| 954 | r := fstest.NewRun(t) |
| 955 | |
| 956 | file1 := r.WriteFile("file1", "file1 contents", t1) |
| 957 | r.CheckLocalItems(t, file1) |
| 958 | |
| 959 | file2 := file1 |
| 960 | file2.Path = "sub/file2" |
| 961 | |
| 962 | err := operations.MoveFile(ctx, r.Fremote, r.Flocal, file2.Path, file1.Path) |
| 963 | require.NoError(t, err) |
| 964 | r.CheckLocalItems(t) |
| 965 | r.CheckRemoteItems(t, file2) |
| 966 | |
| 967 | r.WriteFile("file1", "file1 contents", t1) |
| 968 | r.CheckLocalItems(t, file1) |
| 969 | |
| 970 | err = operations.MoveFile(ctx, r.Fremote, r.Flocal, file2.Path, file1.Path) |
| 971 | require.NoError(t, err) |
| 972 | r.CheckLocalItems(t) |
| 973 | r.CheckRemoteItems(t, file2) |
| 974 | |
| 975 | err = operations.MoveFile(ctx, r.Fremote, r.Fremote, file2.Path, file2.Path) |
| 976 | require.NoError(t, err) |
| 977 | r.CheckLocalItems(t) |
| 978 | r.CheckRemoteItems(t, file2) |
| 979 | } |
| 980 | |
| 981 | func TestMoveFileWithIgnoreExisting(t *testing.T) { |
| 982 | ctx := context.Background() |
nothing calls this directly
no test coverage detected
searching dependent graphs…