(t *testing.T)
| 45 | } |
| 46 | |
| 47 | func TestParseUserPatternsBadPattern(t *testing.T) { |
| 48 | testData := strings.NewReader(`[ |
| 49 | {"name": "httpAuth", "pattern": "/[a-z0-9_/\\.:-]+@[a-z0-9-]+\\.[a-z0-9.-]+"}, |
| 50 | {"name": "base64", "pattern": "^(eyJ|YTo|Tzo|PD[89]|aHR0cHM6L|aHR0cDo|rO0[%a-zA-Z0-9+/]+={0,2}"} |
| 51 | ]`) |
| 52 | |
| 53 | _, err := ParseUserPatterns(testData) |
| 54 | |
| 55 | if err == nil { |
| 56 | t.Error("want non-nil error for ParseUserPatterns(testData) with bad pattern; but have nil", err) |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | func TestParseUserPatternsBadJSON(t *testing.T) { |
| 61 | testData := strings.NewReader(`[ |
nothing calls this directly
no test coverage detected