From 2769863a2d42c8a06d5862b3ef7dc82ae033431e Mon Sep 17 00:00:00 2001 From: Fatih Arslan Date: Wed, 22 Apr 2015 11:19:51 +0300 Subject: [PATCH] color_test: add global test too --- color_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/color_test.go b/color_test.go index 548584e..1dd256a 100644 --- a/color_test.go +++ b/color_test.go @@ -70,7 +70,18 @@ func TestNoColor(t *testing.T) { p.Print(c.text) line, _ := rb.ReadString('\n') + if line != c.text { + t.Errorf("Expecting %s, got '%s'\n", c.text, line) + } + } + // global check + NoColor = true + for _, c := range testColors { + p := New(c.code) + p.Print(c.text) + + line, _ := rb.ReadString('\n') if line != c.text { t.Errorf("Expecting %s, got '%s'\n", c.text, line) }