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{})
| 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") |
| 1980 | func 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 | // |