From 64429c63054106e39d1a28c488d76db534ff2ed5 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 5 Sep 2021 15:55:57 +0300 Subject: fix unit test --- TODO.md | 3 +-- internal/color/color_test.go | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/TODO.md b/TODO.md index 45c9c3b..7fbcca4 100644 --- a/TODO.md +++ b/TODO.md @@ -4,8 +4,7 @@ TODO This is a loose list of what to do. Maybe for the next releae or maybe for a later one. [x] Finalize default color schema -[ ] Use a buffered string builder for brushing the colors in the client. -[ ] Extended color table output (print whole paragraphs in colors) +[x] Use a buffered string builder for brushing the colors in the client. [ ] Implement Benchmark cat-ing a file and compare to prev version. [ ] Client 4.x should print a warning when trying to connect to a 3.x server. [ ] Fix paintClientStats diff --git a/internal/color/color_test.go b/internal/color/color_test.go index bfc7c54..7002052 100644 --- a/internal/color/color_test.go +++ b/internal/color/color_test.go @@ -14,13 +14,13 @@ func TestColors(t *testing.T) { if err != nil { t.Errorf("unable to paint foreground : %s\n%v", text, err) } - builder.WriteString(PaintFg(text, fgColor)) + builder.WriteString(PaintStrFg(text, fgColor)) bgColor, err := ToBgColor(color) if err != nil { t.Errorf("unable to paint background: %s\n%v", text, err) } - builder.WriteString(PaintBg(text, bgColor)) + builder.WriteString(PaintStrBg(text, bgColor)) } for _, fg := range ColorNames { @@ -30,7 +30,7 @@ func TestColors(t *testing.T) { continue } bgColor, _ := ToBgColor(bg) - builder.WriteString(Paint(text, fgColor, bgColor)) + builder.WriteString(PaintStr(text, fgColor, bgColor)) } } @@ -46,7 +46,7 @@ func TestAttributes(t *testing.T) { if err != nil { t.Errorf("unable to paint attribute: %s\n%v", text, err) } - builder.WriteString(PaintWithAttr(text, FgWhite, BgBlue, att)) + builder.WriteString(PaintStrWithAttr(text, FgWhite, BgBlue, att)) } t.Log(builder.String()) -- cgit v1.2.3