MCPcopy Create free account
hub / github.com/stretchr/testify / Regexp

Method Regexp

assert/assertion_forward.go:1515–1520  ·  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

1513// a.Regexp(regexp.MustCompile("start"), "it's starting")
1514// a.Regexp("start...$", "it's not starting")
1515func (a *Assertions) Regexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) bool {
1516 if h, ok := a.t.(tHelper); ok {
1517 h.Helper()
1518 }
1519 return Regexp(a.t, rx, str, msgAndArgs...)
1520}
1521
1522// Regexpf asserts that a specified regexp matches a string.
1523//

Callers 1

TestRegexpWrapperFunction · 0.45

Calls 2

RegexpFunction · 0.70
HelperMethod · 0.65

Tested by 1

TestRegexpWrapperFunction · 0.36