From 19041967a9a2eb6d4cd7dbacaea0366687b852ba Mon Sep 17 00:00:00 2001 From: James Nord Date: Tue, 23 Apr 2019 17:43:14 +0100 Subject: [PATCH] unit test was incorrect for windows. Now that windows coloring behaves correctly the unit test for text_formatter was incorrect. changes the expected test output to be the same regardless of the OS. --- go.sum | 1 + text_formatter_test.go | 7 +------ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/go.sum b/go.sum index 2d787be..e145453 100644 --- a/go.sum +++ b/go.sum @@ -2,6 +2,7 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe h1:CHRGQ8V7OlCYtwaKPJi3iA7J+YdNKdo8j7nG5IgDhjs= github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= diff --git a/text_formatter_test.go b/text_formatter_test.go index 9c5e6f0..e07809d 100644 --- a/text_formatter_test.go +++ b/text_formatter_test.go @@ -5,7 +5,6 @@ import ( "errors" "fmt" "os" - "runtime" "sort" "strings" "testing" @@ -444,11 +443,7 @@ func TestTextFormatterIsColored(t *testing.T) { os.Setenv("CLICOLOR_FORCE", val.clicolorForceVal) } res := tf.isColored() - if runtime.GOOS == "windows" && !tf.ForceColors && !val.clicolorForceIsSet { - assert.Equal(subT, false, res) - } else { - assert.Equal(subT, val.expectedResult, res) - } + assert.Equal(subT, val.expectedResult, res) }) } }