Regexpf asserts that a specified regexp matches a string. assert.Regexpf(t, regexp.MustCompile("start"), "it's starting", "error message %s", "formatted") assert.Regexpf(t, "start...$", "it's not starting", "error message %s", "formatted")
(t TestingT, rx interface{}, str interface{}, msg string, args ...interface{})
| 1867 | // assert.Regexpf(t, regexp.MustCompile("start"), "it's starting", "error message %s", "formatted") |
| 1868 | // assert.Regexpf(t, "start...$", "it's not starting", "error message %s", "formatted") |
| 1869 | func Regexpf(t TestingT, rx interface{}, str interface{}, msg string, args ...interface{}) { |
| 1870 | if h, ok := t.(tHelper); ok { |
| 1871 | h.Helper() |
| 1872 | } |
| 1873 | if assert.Regexpf(t, rx, str, msg, args...) { |
| 1874 | return |
| 1875 | } |
| 1876 | t.FailNow() |
| 1877 | } |
| 1878 | |
| 1879 | // Same asserts that two pointers reference the same object. |
| 1880 | // |