Add regex command implementation
This commit is contained in:
26
tests/integration/regex_conflict_test.go
Normal file
26
tests/integration/regex_conflict_test.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package integration
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"testing"
|
||||
|
||||
renamercmd "github.com/rogeecn/renamer/cmd"
|
||||
)
|
||||
|
||||
func TestRegexApplyBlocksConflicts(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
tmp := t.TempDir()
|
||||
copyRegexFixtureIntegration(t, "case-fold", tmp)
|
||||
|
||||
cmd := renamercmd.NewRootCommand()
|
||||
var out bytes.Buffer
|
||||
cmd.SetOut(&out)
|
||||
cmd.SetErr(&out)
|
||||
cmd.SetArgs([]string{"regex", "^(.*)$", "conflict", "--yes", "--path", tmp})
|
||||
|
||||
err := cmd.Execute()
|
||||
if err == nil {
|
||||
t.Fatalf("expected error when conflicts are present")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user