Better want
Vladimir Bauer
9 years ago
| 98 | 98 | |
| 99 | 99 | bytes := removeLastRune(buf.Bytes()) |
| 100 | 100 | got := string(bytes[len(bytes)-customWidth:]) |
| 101 | want := "[==========================================================]" | |
| 101 | want := fmt.Sprintf("[%s]", strings.Repeat("=", customWidth-2)) | |
| 102 | 102 | if got != want { |
| 103 | 103 | t.Errorf("Expected format: %s, got %s\n", want, got) |
| 104 | 104 | } |