MCPcopy Create free account
hub / github.com/github/gh-aw / TestSanitizeErrorMessage_MixedCase

Function TestSanitizeErrorMessage_MixedCase

pkg/stringutil/sanitize_test.go:118–147  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

116}
117
118func TestSanitizeErrorMessage_MixedCase(t *testing.T) {
119 tests := []struct {
120 name string
121 message string
122 expected string
123 }{
124 {
125 name: "lowercase not matched",
126 message: "error with my_secret_key",
127 expected: "error with my_secret_key",
128 },
129 {
130 name: "mixed case not matched",
131 message: "error with My_Secret_Key",
132 expected: "error with My_Secret_Key",
133 },
134 {
135 name: "all uppercase matched",
136 message: "error with MY_SECRET_KEY",
137 expected: "error with [REDACTED]",
138 },
139 }
140
141 for _, tt := range tests {
142 t.Run(tt.name, func(t *testing.T) {
143 result := SanitizeErrorMessage(tt.message)
144 assertSanitizeResult(t, "SanitizeErrorMessage", tt.message, result, tt.expected)
145 })
146 }
147}
148
149func TestSanitizeErrorMessage_PascalCaseVariants(t *testing.T) {
150 tests := []struct {

Callers

nothing calls this directly

Calls 3

SanitizeErrorMessageFunction · 0.85
assertSanitizeResultFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected