Implement finalized test suite for the CLI and configuration code
This commit is contained in:
14
internal/cli/contract_test_helpers_test.go
Normal file
14
internal/cli/contract_test_helpers_test.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user