MCPcopy
hub / github.com/expr-lang/expr / NotRegexp

Function NotRegexp

internal/testify/assert/assertions.go:1652–1664  ·  view source on GitHub ↗

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{})

Source from the content-addressed store, hash-verified

1650// assert.NotRegexp(t, regexp.MustCompile("starts"), "it's starting")
1651// assert.NotRegexp(t, "^start", "it's not starting")
1652func 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.
1667func Zero(t TestingT, i interface{}, msgAndArgs ...interface{}) bool {

Callers 4

NotRegexpFunction · 0.92
NotRegexpfFunction · 0.70
TestRegexpFunction · 0.70
NotRegexpMethod · 0.70

Calls 4

matchRegexpFunction · 0.85
SprintfMethod · 0.80
FailFunction · 0.70
HelperMethod · 0.45

Tested by 1

TestRegexpFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…