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)
| 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. |
| 293 | func 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 | |
| 304 | func messageFromMsgAndArgs(msgAndArgs ...interface{}) string { |
| 305 | if len(msgAndArgs) == 0 || msgAndArgs == nil { |