kitty/tools/cli/infrastructure_test.go
2022-11-14 15:41:44 +05:30

19 lines
394 B
Go

package cli
import (
"strings"
"testing"
)
func TestFormatLineWithIndent(t *testing.T) {
var output strings.Builder
output.Reset()
indent := " "
format_line_with_indent(&output, "testing \x1b[31mstyled\x1b[m", indent, 11)
expected := indent + "testing \n" + indent + "\x1b[31mstyled\x1b[m\n"
if output.String() != expected {
t.Errorf("%#v != %#v", expected, output.String())
}
}