MCPcopy Create free account
hub / github.com/tbphp/gpt-load / TestRedactSecretEmptySecret

Function TestRedactSecretEmptySecret

internal/utils/string_utils_test.go:44–52  ·  view source on GitHub ↗

TestRedactSecretEmptySecret asserts an empty secret leaves the text untouched (guards against strings.ReplaceAll's pathological behavior on an empty old value).

(t *testing.T)

Source from the content-addressed store, hash-verified

42// TestRedactSecretEmptySecret asserts an empty secret leaves the text untouched
43// (guards against strings.ReplaceAll's pathological behavior on an empty old value).
44func TestRedactSecretEmptySecret(t *testing.T) {
45 text := "some upstream error with no secret"
46
47 got := RedactSecret(text, "")
48
49 if got != text {
50 t.Errorf("RedactSecret() with empty secret = %q, want unchanged %q", got, text)
51 }
52}
53
54// TestRedactSecretNotPresent asserts text without the secret is returned unchanged.
55func TestRedactSecretNotPresent(t *testing.T) {

Callers

nothing calls this directly

Calls 1

RedactSecretFunction · 0.85

Tested by

no test coverage detected