mirror of
https://github.com/itchyny/mmv.git
synced 2025-12-31 01:35:06 +08:00
rename Move to Rename
This commit is contained in:
parent
72dc9b0e83
commit
5515f2c87a
2 changed files with 4 additions and 4 deletions
4
mmv.go
4
mmv.go
|
|
@ -7,8 +7,8 @@ import (
|
|||
"path/filepath"
|
||||
)
|
||||
|
||||
// Move multiple files.
|
||||
func Move(files map[string]string) error {
|
||||
// Rename multiple files.
|
||||
func Rename(files map[string]string) error {
|
||||
rs, err := buildRenames(files)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import (
|
|||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestMove(t *testing.T) {
|
||||
func TestRename(t *testing.T) {
|
||||
testCases := []struct {
|
||||
name string
|
||||
files map[string]string
|
||||
|
|
@ -192,7 +192,7 @@ func TestMove(t *testing.T) {
|
|||
require.NoError(t, setupFiles(tc.contents))
|
||||
rs, _ := buildRenames(tc.files)
|
||||
assert.Equal(t, tc.cnt, len(rs))
|
||||
got := Move(tc.files)
|
||||
got := Rename(tc.files)
|
||||
if tc.err == nil {
|
||||
require.NoError(t, got)
|
||||
assert.Equal(t, tc.expected, fileContents("."))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue