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)
| 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. |
| 273 | func 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 | |
| 284 | func messageFromMsgAndArgs(msgAndArgs ...interface{}) string { |
| 285 | if len(msgAndArgs) == 0 || msgAndArgs == nil { |
no outgoing calls
no test coverage detected
searching dependent graphs…