MCPcopy Create free account
hub / github.com/stretchr/testify / isTest

Function isTest

assert/assertions.go:275–284  ·  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

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

Callers 1

CallerInfoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected