Implement finalized test suite for the CLI and configuration code

This commit is contained in:
2026-07-18 12:14:46 -05:00
parent a586257d5e
commit 4d3351c774
5 changed files with 118 additions and 44 deletions

View File

@@ -0,0 +1,14 @@
package cli
import (
"strings"
"testing"
)
func replaceRequiredOnce(t *testing.T, input, old, replacement string) string {
t.Helper()
if count := strings.Count(input, old); count != 1 {
t.Fatalf("replacement marker %q occurs %d times, want exactly once", old, count)
}
return strings.Replace(input, old, replacement, 1)
}