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{})
| 1742 | // assert.NotRegexp(t, regexp.MustCompile("starts"), "it's starting") |
| 1743 | // assert.NotRegexp(t, "^start", "it's not starting") |
| 1744 | func NotRegexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) bool { |
| 1745 | if h, ok := t.(tHelper); ok { |
| 1746 | h.Helper() |
| 1747 | } |
| 1748 | match := matchRegexp(rx, str) |
| 1749 | |
| 1750 | if match { |
| 1751 | Fail(t, fmt.Sprintf("Expect \"%v\" to NOT match \"%v\"", str, rx), msgAndArgs...) |
| 1752 | } |
| 1753 | |
| 1754 | return !match |
| 1755 | } |
| 1756 | |
| 1757 | // Zero asserts that i is the zero value for its type. |
| 1758 | func Zero(t TestingT, i interface{}, msgAndArgs ...interface{}) bool { |