Add regex command implementation

This commit is contained in:
Rogee
2025-10-31 10:12:02 +08:00
parent a0d7084c28
commit d436970848
55 changed files with 2115 additions and 9 deletions

View 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")
}
}