MCPcopy Create free account
hub / github.com/BishopFox/jsluice / TestParseUserPatternsBadPattern

Function TestParseUserPatternsBadPattern

user-patterns_test.go:47–58  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

45}
46
47func 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
60func TestParseUserPatternsBadJSON(t *testing.T) {
61 testData := strings.NewReader(`[

Callers

nothing calls this directly

Calls 1

ParseUserPatternsFunction · 0.85

Tested by

no test coverage detected