@@ -437,6 +437,36 @@ func TestTransformFile(t *testing.T) {
437437 r .CheckRemoteListing (t , []fstest.Item {fstest .NewItem ("toe/toe/toe.txt" , "hello world" , t1 )}, []string {"tictacempty_dir" , "tictactoe" , "tictactoe/tictactoe" , "toe" , "toe/toe" })
438438}
439439
440+ func TestManualTransformFile (t * testing.T ) {
441+ ctx := context .Background ()
442+ r := fstest .NewRun (t )
443+
444+ r .Flocal .Features ().DisableList ([]string {"Copy" , "Move" })
445+ r .Fremote .Features ().DisableList ([]string {"Copy" , "Move" })
446+
447+ err := transform .SetOptions (ctx , "all,prefix=tac" , "all,prefix=tic" )
448+ require .NoError (t , err )
449+ r .WriteFile ("toe/toe/toe.txt" , "hello world" , t1 )
450+ _ , err = operations .MkdirModTime (ctx , r .Flocal , "empty_dir" , t1 )
451+ require .NoError (t , err )
452+
453+ r .Mkdir (ctx , r .Fremote )
454+ ctx = predictDstFromLogger (ctx )
455+ err = MoveDir (ctx , r .Fremote , r .Flocal , true , true )
456+ testLoggerVsLsf (ctx , r .Fremote , r .Flocal , operations .GetLoggerOpt (ctx ).JSON , t )
457+ require .NoError (t , err )
458+
459+ r .CheckLocalListing (t , []fstest.Item {}, []string {})
460+ r .CheckRemoteListing (t , []fstest.Item {fstest .NewItem ("tictactoe/tictactoe/tictactoe.txt" , "hello world" , t1 )}, []string {"tictacempty_dir" , "tictactoe" , "tictactoe/tictactoe" })
461+
462+ err = transform .SetOptions (ctx , "all,trimprefix=tic" , "all,trimprefix=tac" )
463+ require .NoError (t , err )
464+ err = operations .TransformFile (ctx , r .Fremote , "tictactoe/tictactoe/tictactoe.txt" )
465+ require .NoError (t , err )
466+ r .CheckLocalListing (t , []fstest.Item {}, []string {})
467+ r .CheckRemoteListing (t , []fstest.Item {fstest .NewItem ("toe/toe/toe.txt" , "hello world" , t1 )}, []string {"tictacempty_dir" , "tictactoe" , "tictactoe/tictactoe" , "toe" , "toe/toe" })
468+ }
469+
440470func TestBase64 (t * testing.T ) {
441471 ctx := context .Background ()
442472 r := fstest .NewRun (t )
0 commit comments