NotRegexp asserts that a specified regexp does not match a string. assert.NotRegexp(t, regexp.MustCompile("starts"), "it's starting") assert.NotRegexp(t, "^start", "it's not starting")
(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{})
| 1650 | // assert.NotRegexp(t, regexp.MustCompile("starts"), "it's starting") |
| 1651 | // assert.NotRegexp(t, "^start", "it's not starting") |
| 1652 | func NotRegexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) bool { |
| 1653 | if h, ok := t.(tHelper); ok { |
| 1654 | h.Helper() |
| 1655 | } |
| 1656 | match := matchRegexp(rx, str) |
| 1657 | |
| 1658 | if match { |
| 1659 | Fail(t, fmt.Sprintf("Expect \"%v\" to NOT match \"%v\"", str, rx), msgAndArgs...) |
| 1660 | } |
| 1661 | |
| 1662 | return !match |
| 1663 | |
| 1664 | } |
| 1665 | |
| 1666 | // Zero asserts that i is the zero value for its type. |
| 1667 | func Zero(t TestingT, i interface{}, msgAndArgs ...interface{}) bool { |
searching dependent graphs…