(t *testing.T)
| 3597 | } |
| 3598 | |
| 3599 | func Test_truncatingFormat(t *testing.T) { |
| 3600 | t.Parallel() |
| 3601 | |
| 3602 | original := strings.Repeat("a", bufio.MaxScanTokenSize-102) |
| 3603 | result := truncatingFormat(original) |
| 3604 | Equal(t, fmt.Sprintf("%#v", original), result, "string should not be truncated") |
| 3605 | |
| 3606 | original = original + "x" |
| 3607 | result = truncatingFormat(original) |
| 3608 | NotEqual(t, fmt.Sprintf("%#v", original), result, "string should have been truncated.") |
| 3609 | |
| 3610 | if !strings.HasSuffix(result, "<... truncated>") { |
| 3611 | t.Error("truncated string should have <... truncated> suffix") |
| 3612 | } |
| 3613 | } |
| 3614 | |
| 3615 | // parseLabeledOutput does the inverse of labeledOutput - it takes a formatted |
| 3616 | // output string and turns it back into a slice of labeledContent. |
nothing calls this directly
no test coverage detected