Skip to content

Commit

Permalink
fix: color detect tests error
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Apr 1, 2021
1 parent f7f679a commit c89242c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions color.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ func SupportColor() bool {
return colorLevel > terminfo.ColorLevelNone
}

// Support16Color on the current ENV
// func Support16Color() bool {
// return colorLevel > terminfo.ColorLevelNone
// }

// Support256Color on the current ENV
func Support256Color() bool {
return colorLevel > terminfo.ColorLevelBasic
Expand Down
6 changes: 3 additions & 3 deletions color_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,18 +124,18 @@ func TestSet(t *testing.T) {
func TestSupportColor(t *testing.T) {
is := assert.New(t)

if is.True(SupportTrueColor()) {
if SupportTrueColor() {
is.True(SupportColor())
is.True(Support256Color())
}

if is.True(Support256Color()) {
if Support256Color() {
is.True(SupportColor())
} else {
is.False(SupportTrueColor())
}

if is.False(SupportColor()) {
if false == SupportColor() {
is.False(Support256Color())
is.False(SupportTrueColor())
}
Expand Down

0 comments on commit c89242c

Please sign in to comment.