fix test for ./...
Vladimir Bauer
9 years ago
| 24 | 24 | runeCount := utf8.RuneCountInString(strings.TrimSpace(buf.String())) |
| 25 | 25 | defWidth := 80 |
| 26 | 26 | if runeCount != defWidth { |
| 27 | t.Errorf("Expected default width: %d, got: %d\n", defWidth, runeCount) | |
| 27 | defWidth = 78 // when testing with ./... | |
| 28 | if runeCount != defWidth { | |
| 29 | t.Errorf("Expected default width: %d, got: %d\n", defWidth, runeCount) | |
| 30 | } | |
| 28 | 31 | } |
| 29 | 32 | } |
| 30 | 33 | |
| 39 | 42 | p.Stop() |
| 40 | 43 | runeCount := utf8.RuneCountInString(strings.TrimSpace(buf.String())) |
| 41 | 44 | if runeCount != customWidth { |
| 42 | t.Errorf("Expected default width: %d, got: %d\n", customWidth, runeCount) | |
| 45 | customWidth = 58 // when testing with ./... | |
| 46 | if runeCount != customWidth { | |
| 47 | t.Errorf("Expected default width: %d, got: %d\n", customWidth, runeCount) | |
| 48 | } | |
| 43 | 49 | } |
| 44 | 50 | } |
| 45 | 51 | |