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

Function Regexpf

require/require.go:1980–1988  ·  view source on GitHub ↗

Regexpf asserts that a specified regexp matches a string. require.Regexpf(t, regexp.MustCompile("start"), "it's starting", "error message %s", "formatted") require.Regexpf(t, "start...$", "it's not starting", "error message %s", "formatted")

(t TestingT, rx interface{}, str interface{}, msg string, args ...interface{})

Source from the content-addressed store, hash-verified

1978// require.Regexpf(t, regexp.MustCompile("start"), "it's starting", "error message %s", "formatted")
1979// require.Regexpf(t, "start...$", "it's not starting", "error message %s", "formatted")
1980func Regexpf(t TestingT, rx interface{}, str interface{}, msg string, args ...interface{}) {
1981 if h, ok := t.(tHelper); ok {
1982 h.Helper()
1983 }
1984 if assert.Regexpf(t, rx, str, msg, args...) {
1985 return
1986 }
1987 t.FailNow()
1988}
1989
1990// Same asserts that two pointers reference the same object.
1991//

Callers 1

RegexpfMethod · 0.70

Calls 3

RegexpfFunction · 0.92
HelperMethod · 0.65
FailNowMethod · 0.65

Tested by

no test coverage detected