(t *testing.T)
| 413 | } |
| 414 | |
| 415 | func TestTransformFile(t *testing.T) { |
| 416 | ctx := context.Background() |
| 417 | r := fstest.NewRun(t) |
| 418 | err := transform.SetOptions(ctx, "all,prefix=tac", "all,prefix=tic") |
| 419 | require.NoError(t, err) |
| 420 | r.WriteFile("toe/toe/toe.txt", "hello world", t1) |
| 421 | _, err = operations.MkdirModTime(ctx, r.Flocal, "empty_dir", t1) |
| 422 | require.NoError(t, err) |
| 423 | |
| 424 | r.Mkdir(ctx, r.Fremote) |
| 425 | ctx = predictDstFromLogger(ctx) |
| 426 | err = MoveDir(ctx, r.Fremote, r.Flocal, true, true) |
| 427 | testLoggerVsLsf(ctx, r.Fremote, r.Flocal, operations.GetLoggerOpt(ctx).JSON, t) |
| 428 | require.NoError(t, err) |
| 429 | |
| 430 | r.CheckLocalListing(t, []fstest.Item{}, []string{}) |
| 431 | r.CheckRemoteListing(t, []fstest.Item{fstest.NewItem("tictactoe/tictactoe/tictactoe.txt", "hello world", t1)}, []string{"tictacempty_dir", "tictactoe", "tictactoe/tictactoe"}) |
| 432 | |
| 433 | err = transform.SetOptions(ctx, "all,trimprefix=tic", "all,trimprefix=tac") |
| 434 | require.NoError(t, err) |
| 435 | err = operations.TransformFile(ctx, r.Fremote, "tictactoe/tictactoe/tictactoe.txt") |
| 436 | require.NoError(t, err) |
| 437 | r.CheckLocalListing(t, []fstest.Item{}, []string{}) |
| 438 | r.CheckRemoteListing(t, []fstest.Item{fstest.NewItem("toe/toe/toe.txt", "hello world", t1)}, []string{"tictacempty_dir", "tictactoe", "tictactoe/tictactoe", "toe", "toe/toe"}) |
| 439 | } |
| 440 | |
| 441 | func TestManualTransformFile(t *testing.T) { |
| 442 | ctx := context.Background() |
nothing calls this directly
no test coverage detected
searching dependent graphs…