mirror of https://github.com/sirupsen/logrus.git
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.
This commit is contained in:
parent
606ffcaf8f
commit
19041967a9
1
go.sum
1
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=
|
||||
|
|
|
@ -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)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue