(t *testing.T)
| 133 | } |
| 134 | |
| 135 | func TestErrorf(t *testing.T) { |
| 136 | err := Errorf("quoted = %q, quotedSafe = %q, int = %d, intSafe = %d", |
| 137 | "sensitive", Safe("safe"), |
| 138 | 123, Safe(789), |
| 139 | ) |
| 140 | checkUnredactedError(t, err, `quoted = "sensitive", quotedSafe = "safe", int = 123, intSafe = 789`) |
| 141 | checkRedactedError(t, err, `quoted = <redacted string>, quotedSafe = "safe", int = <redacted int>, intSafe = 789`) |
| 142 | |
| 143 | // Redact again to check that we don't wipe out the already-redacted message. |
| 144 | checkRedactedError(t, Error(err), `quoted = <redacted string>, quotedSafe = "safe", int = <redacted int>, intSafe = 789`) |
| 145 | } |
| 146 | |
| 147 | func TestErrorfWrapErrorf(t *testing.T) { |
| 148 | wrapped := Errorf("wrapped string = %s, wrapped safe string = %s", "sensitive", Safe("safe")) |
nothing calls this directly
no test coverage detected