MCPcopy
hub / github.com/stretchr/testify / isTest

Function isTest

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

291// It is a Test (say) if there is a character after Test that is not a lower-case letter.
292// We don't want TesticularCancer.
293func isTest(name, prefix string) bool {
294 if !strings.HasPrefix(name, prefix) {
295 return false
296 }
297 if len(name) == len(prefix) { // "Test" is ok
298 return true
299 }
300 r, _ := utf8.DecodeRuneInString(name[len(prefix):])
301 return !unicode.IsLower(r)
302}
303
304func messageFromMsgAndArgs(msgAndArgs ...interface{}) string {
305 if len(msgAndArgs) == 0 || msgAndArgs == nil {

Callers 1

CallerInfoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected