(t *testing.T)
| 3239 | } |
| 3240 | |
| 3241 | func TestSanitizeURL(t *testing.T) { |
| 3242 | t.Parallel() |
| 3243 | tests := []struct { |
| 3244 | in, want string |
| 3245 | }{ |
| 3246 | {"/?a=b", "/?a=b"}, |
| 3247 | {"/?a=b&client_secret=secret", "/?a=b&client_secret=REDACTED"}, |
| 3248 | {"/?a=b&client_id=id&client_secret=secret", "/?a=b&client_id=id&client_secret=REDACTED"}, |
| 3249 | {"/?a=b&access_token=secret", "/?a=b&access_token=REDACTED"}, |
| 3250 | {"/?a=b&token=secret", "/?a=b&token=REDACTED"}, |
| 3251 | {"/?client_secret=s&access_token=t&token=u", "/?access_token=REDACTED&client_secret=REDACTED&token=REDACTED"}, |
| 3252 | } |
| 3253 | |
| 3254 | for _, tt := range tests { |
| 3255 | inURL, _ := url.Parse(tt.in) |
| 3256 | want, _ := url.Parse(tt.want) |
| 3257 | |
| 3258 | if got := sanitizeURL(inURL); !cmp.Equal(got, want) { |
| 3259 | t.Errorf("sanitizeURL(%v) returned %v, want %v", tt.in, got, want) |
| 3260 | } |
| 3261 | } |
| 3262 | } |
| 3263 | |
| 3264 | func TestCheckResponse(t *testing.T) { |
| 3265 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…