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

Function Regexp

require/require.go:1966–1974  ·  view source on GitHub ↗

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

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

Source from the content-addressed store, hash-verified

1964// require.Regexp(t, regexp.MustCompile("start"), "it's starting")
1965// require.Regexp(t, "start...$", "it's not starting")
1966func Regexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) {
1967 if h, ok := t.(tHelper); ok {
1968 h.Helper()
1969 }
1970 if assert.Regexp(t, rx, str, msgAndArgs...) {
1971 return
1972 }
1973 t.FailNow()
1974}
1975
1976// Regexpf asserts that a specified regexp matches a string.
1977//

Callers 1

RegexpMethod · 0.70

Calls 3

RegexpFunction · 0.92
HelperMethod · 0.65
FailNowMethod · 0.65

Tested by

no test coverage detected