TestRedactSecretEmptySecret asserts an empty secret leaves the text untouched (guards against strings.ReplaceAll's pathological behavior on an empty old value).
(t *testing.T)
| 42 | // TestRedactSecretEmptySecret asserts an empty secret leaves the text untouched |
| 43 | // (guards against strings.ReplaceAll's pathological behavior on an empty old value). |
| 44 | func 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. |
| 55 | func TestRedactSecretNotPresent(t *testing.T) { |
nothing calls this directly
no test coverage detected