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

func emptyLookup(string) (string, bool) { return "", false }
