(t *testing.T)
| 3123 | } |
| 3124 | |
| 3125 | func Test_truncatingFormat(t *testing.T) { |
| 3126 | |
| 3127 | original := strings.Repeat("a", bufio.MaxScanTokenSize-102) |
| 3128 | result := truncatingFormat(original) |
| 3129 | Equal(t, fmt.Sprintf("%#v", original), result, "string should not be truncated") |
| 3130 | |
| 3131 | original = original + "x" |
| 3132 | result = truncatingFormat(original) |
| 3133 | NotEqual(t, fmt.Sprintf("%#v", original), result, "string should have been truncated.") |
| 3134 | |
| 3135 | if !strings.HasSuffix(result, "<... truncated>") { |
| 3136 | t.Error("truncated string should have <... truncated> suffix") |
| 3137 | } |
| 3138 | } |
| 3139 | |
| 3140 | // parseLabeledOutput does the inverse of labeledOutput - it takes a formatted |
| 3141 | // output string and turns it back into a slice of labeledContent. |
nothing calls this directly
no test coverage detected