stringizeWants converts a slice of wanted test output into a format suitable for a test error message.
(wants []string)
| 92 | // stringizeWants converts a slice of wanted test output into a format suitable |
| 93 | // for a test error message. |
| 94 | func stringizeWants(wants []string) string { |
| 95 | s := "" |
| 96 | for i, want := range wants { |
| 97 | if i > 0 { |
| 98 | s += fmt.Sprintf("want%d: %s", i+1, want) |
| 99 | } else { |
| 100 | s += "want: " + want |
| 101 | } |
| 102 | } |
| 103 | return s |
| 104 | } |
| 105 | |
| 106 | // testFailed returns whether or not a test failed by checking if the result |
| 107 | // of the test is in the slice of wanted strings. |
no test coverage detected
searching dependent graphs…