2026-07-18 12:14:46 -05:00
|
|
|
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)
|
|
|
|
|
}
|
2026-07-18 23:38:59 +00:00
|
|
|
|
|
|
|
|
func emptyLookup(string) (string, bool) { return "", false }
|