MCPcopy
hub / github.com/stretchr/testify / Regexp

Method Regexp

assert/assertion_forward.go:1557–1562  ·  view source on GitHub ↗

Regexp asserts that a specified regexp matches a string. a.Regexp(regexp.MustCompile("start"), "it's starting") a.Regexp("start...$", "it's not starting")

(rx interface{}, str interface{}, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

1555// a.Regexp(regexp.MustCompile("start"), "it's starting")
1556// a.Regexp("start...$", "it's not starting")
1557func (a *Assertions) Regexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) bool {
1558 if h, ok := a.t.(tHelper); ok {
1559 h.Helper()
1560 }
1561 return Regexp(a.t, rx, str, msgAndArgs...)
1562}
1563
1564// Regexpf asserts that a specified regexp matches a string.
1565//

Callers 1

TestRegexpWrapperFunction · 0.45

Calls 2

RegexpFunction · 0.70
HelperMethod · 0.65

Tested by 1

TestRegexpWrapperFunction · 0.36