Commit graph

23 commits

Author SHA1 Message Date
itchyny
8d31a98aa7 switch from deprecated io/ioutil to os package 2023-04-09 12:22:40 +09:00
itchyny
4ce13f9e9e support directory renames (close #11)
- reject invalid renames (ex: move x x/x)
- move to a temporary path before any parent directory is moved
- rename in increasing destination directory depth order
2021-01-07 21:42:34 +09:00
itchyny
a25a89e162 use t.Cleanup instead of defer 2020-08-14 01:31:47 +09:00
itchyny
cbe026840a remove dependency on github.com/stretchr/testify 2020-08-14 01:31:44 +09:00
itchyny
10d2c971a8 apply gofumpt 2020-08-14 01:16:58 +09:00
itchyny
0ed17e263c undo the processed renames on error 2020-01-09 13:08:26 +09:00
itchyny
2a878af8f0 change error in tests to string 2020-01-09 13:02:51 +09:00
itchyny
42b640ffe3 test the file contents even on failure cases 2020-01-09 12:08:07 +09:00
Yasuhiro Matsumoto
51e509c280
Fix test for Windows 2020-01-08 19:38:53 +09:00
itchyny
4ca8bb541c tweak temporary directory name in tests 2020-01-08 19:00:08 +09:00
itchyny
8197e82aaa create destination directory 2020-01-08 16:39:30 +09:00
itchyny
7af6308cbb fix name of temporary file in tests 2020-01-08 13:26:58 +09:00
itchyny
58fad679e1 rename cnt to count in the tests 2020-01-08 11:10:39 +09:00
itchyny
ac672113f2 check same source path after clean 2020-01-08 11:10:27 +09:00
itchyny
7ab2aee878 clone files for rename count test 2020-01-08 11:09:14 +09:00
itchyny
d838f2b136 remove renames with same source and destination 2020-01-08 09:02:17 +09:00
itchyny
0926ef4faa clean source path as well to allow directory rename cycle 2020-01-08 01:21:15 +09:00
itchyny
5515f2c87a rename Move to Rename 2020-01-08 00:40:54 +09:00
itchyny
72dc9b0e83 check destination error on cleaned path 2020-01-08 00:40:54 +09:00
itchyny
0e578e6b83 return error on empty path 2020-01-08 00:40:54 +09:00
itchyny
8d8905510f return error on duplicate destination 2020-01-08 00:40:54 +09:00
itchyny
33d7af2229 implement cycle renames 2020-01-08 00:40:54 +09:00
itchyny
c7ce5a25a1 add test cases 2020-01-08 00:40:53 +09:00