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

Function TestParseUserPatternsBadJSON

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

Source from the content-addressed store, hash-verified

58}
59
60func TestParseUserPatternsBadJSON(t *testing.T) {
61 testData := strings.NewReader(`[
62 {"name": "httpAuth", "pattern": "/[a-z0-9_/\\.:-]+@[a-z0-9-]+\\.[a-z0-9.-]+"},
63 {"name": "base64", "pattern": "^(eyJ|YTo|Tzo|PD
64 ]`)
65
66 _, err := ParseUserPatterns(testData)
67
68 if err == nil {
69 t.Error("want non-nil error for ParseUserPatterns(testData) with bad JSON; but have nil", err)
70 }
71}

Callers

nothing calls this directly

Calls 1

ParseUserPatternsFunction · 0.85

Tested by

no test coverage detected