MCPcopy Index your code
hub / github.com/expr-lang/expr / isTest

Function isTest

internal/testify/assert/assertions.go:273–282  ·  view source on GitHub ↗

Stolen from the `go test` tool. isTest tells whether name looks like a test (or benchmark, according to prefix). It is a Test (say) if there is a character after Test that is not a lower-case letter. We don't want TesticularCancer.

(name, prefix string)

Source from the content-addressed store, hash-verified

271// It is a Test (say) if there is a character after Test that is not a lower-case letter.
272// We don't want TesticularCancer.
273func isTest(name, prefix string) bool {
274 if !strings.HasPrefix(name, prefix) {
275 return false
276 }
277 if len(name) == len(prefix) { // "Test" is ok
278 return true
279 }
280 r, _ := utf8.DecodeRuneInString(name[len(prefix):])
281 return !unicode.IsLower(r)
282}
283
284func messageFromMsgAndArgs(msgAndArgs ...interface{}) string {
285 if len(msgAndArgs) == 0 || msgAndArgs == nil {

Callers 1

CallerInfoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…