Skip to content

Commit

Permalink
up: update tests on windows OS. update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Apr 6, 2021
1 parent 9f91073 commit 02c98f1
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go_version: [1.11, 1.12, 1.13, 1.14, 1.15]
go_version: [1.11, 1.12, 1.13, 1.14, 1.15, 1.16]
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
Expand Down
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -435,6 +435,12 @@ there are some useful functions reference
- `RgbToHex(rgb []int) string` Convert RGB to hex code
- More useful func please see https://pkg.go.dev/github.com/gookit/color

## Project use

Check out these projects, which use https://github.com/gookit/color :

- https://github.com/Delta456/box-cli-maker Make Highly Customized Boxes for your CLI

## Gookit packages

- [gookit/ini](https://github.com/gookit/ini) Go config management, use INI files
Expand Down
6 changes: 6 additions & 0 deletions README.zh-CN.md
Expand Up @@ -403,6 +403,12 @@ s.Printf("style with %s\n", "options")
- `RgbToHex(rgb []int) string` Convert RGB to hex code
- 更多请查看文档 https://pkg.go.dev/github.com/gookit/color

## 使用color的项目

看看这些使用了 https://github.com/gookit/color 的项目:

- https://github.com/Delta456/box-cli-maker Make Highly Customized Boxes for your CLI

## Gookit 工具包

- [gookit/ini](https://github.com/gookit/ini) INI配置读取管理,支持多文件加载,数据覆盖合并, 解析ENV变量, 解析变量引用
Expand Down
15 changes: 10 additions & 5 deletions utils_test.go
Expand Up @@ -55,18 +55,20 @@ ZSH_TMUX_TERM=screen-256color
is.True(IsSupport16Color())
is.True(IsSupportColor())
})
}

func TestIsDetectColorLevel_unix(t *testing.T) {
if IsWindows() {
return
}
is := assert.New(t)

// TERM
mockOsEnvByText("TERM=screen-256color", func() {
is.Equal(Level256, DetectColorLevel())
is.False(IsSupportTrueColor())
is.True(IsSupport256Color())
is.True(IsSupportColor())
})
}

func TestIsDetectColorLevel_unix(t *testing.T) {
is := assert.New(t)

// TERM_PROGRAM=Terminus
mockOsEnvByText(`
Expand Down Expand Up @@ -122,6 +124,9 @@ ZSH_TMUX_TERM=screen-256color
}

func TestIsDetectColorLevel_screen(t *testing.T) {
if IsWindows() {
return
}
is := assert.New(t)

// TERM_PROGRAM=Apple_Terminal use screen
Expand Down

0 comments on commit 02c98f1

Please sign in to comment.