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{})
| 1964 | // require.Regexp(t, regexp.MustCompile("start"), "it's starting") |
| 1965 | // require.Regexp(t, "start...$", "it's not starting") |
| 1966 | func 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 | // |