MCPcopy Create free account
hub / github.com/gavv/httpexpect / NewMatch

Function NewMatch

match.go:36–39  ·  view source on GitHub ↗

NewMatch returns a new Match instance. If reporter is nil, the function panics. Both submatchValues and submatchNames may be nil. Example: s := "http://example.com/users/john" r := regexp.MustCompile(`http://(?P .+)/users/(?P .+)`) m := NewMatch(t, r.FindStringSubmatch(s), r.SubexpN

(reporter Reporter, submatchValues []string, submatchNames []string)

Source from the content-addressed store, hash-verified

34// m.NamedSubmatch("host").IsEqual("example.com")
35// m.NamedSubmatch("user").IsEqual("john")
36func NewMatch(reporter Reporter, submatchValues []string, submatchNames []string) *Match {
37 return newMatch(
38 newChainWithDefaults("Match()", reporter), submatchValues, submatchNames)
39}
40
41// NewMatchC returns a new Match instance with config.
42//

Callers 6

TestMatch_ConstructorsFunction · 0.85
TestMatch_RawFunction · 0.85
TestMatch_AliasFunction · 0.85
TestMatch_GettersFunction · 0.85
TestMatch_IsEmptyFunction · 0.85
TestMatch_ValuesFunction · 0.85

Calls 2

newMatchFunction · 0.85
newChainWithDefaultsFunction · 0.85

Tested by 6

TestMatch_ConstructorsFunction · 0.68
TestMatch_RawFunction · 0.68
TestMatch_AliasFunction · 0.68
TestMatch_GettersFunction · 0.68
TestMatch_IsEmptyFunction · 0.68
TestMatch_ValuesFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…