(t *testing.T)
| 2909 | } |
| 2910 | |
| 2911 | func Test_truncatingFormat(t *testing.T) { |
| 2912 | |
| 2913 | original := strings.Repeat("a", bufio.MaxScanTokenSize-102) |
| 2914 | result := truncatingFormat(original) |
| 2915 | Equal(t, fmt.Sprintf("%#v", original), result, "string should not be truncated") |
| 2916 | |
| 2917 | original = original + "x" |
| 2918 | result = truncatingFormat(original) |
| 2919 | NotEqual(t, fmt.Sprintf("%#v", original), result, "string should have been truncated.") |
| 2920 | |
| 2921 | if !strings.HasSuffix(result, "<... truncated>") { |
| 2922 | t.Error("truncated string should have <... truncated> suffix") |
| 2923 | } |
| 2924 | } |
| 2925 | |
| 2926 | // parseLabeledOutput does the inverse of labeledOutput - it takes a formatted |
| 2927 | // output string and turns it back into a slice of labeledContent. |
nothing calls this directly
no test coverage detected
searching dependent graphs…