-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolors_test.go
77 lines (74 loc) · 1.99 KB
/
colors_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package consolestyle_test
import (
"testing"
"github.com/ortense/consolestyle"
)
func TestColors(t *testing.T) {
run(t, map[string]testcase{
"consolestyle.Red": {
input: "text with color",
act: consolestyle.Red,
expected: "\x1b[31mtext with color\x1b[39m",
},
"consolestyle.Green": {
input: "text with color",
act: consolestyle.Green,
expected: "\x1b[32mtext with color\x1b[39m",
},
"consolestyle.Yellow": {
input: "text with color",
act: consolestyle.Yellow,
expected: "\x1b[33mtext with color\x1b[39m",
},
"consolestyle.Blue": {
input: "text with color",
act: consolestyle.Blue,
expected: "\x1b[34mtext with color\x1b[39m",
},
"consolestyle.Magenta": {
input: "text with color",
act: consolestyle.Magenta,
expected: "\x1b[35mtext with color\x1b[39m",
},
"consolestyle.Cyan": {
input: "text with color",
act: consolestyle.Cyan,
expected: "\x1b[36mtext with color\x1b[39m",
},
"consolestyle.BgRed": {
input: "text with color",
act: consolestyle.BgRed,
expected: "\x1b[41mtext with color\x1b[49m",
},
"consolestyle.BgGree": {
input: "text with color",
act: consolestyle.BgGreen,
expected: "\x1b[42mtext with color\x1b[49m",
},
"colors.bgYellow": {
input: "text with color",
act: consolestyle.BgYellow,
expected: "\x1b[43mtext with color\x1b[49m",
},
"consolestyle.BgBlue,": {
input: "text with color",
act: consolestyle.BgBlue,
expected: "\x1b[44mtext with color\x1b[49m",
},
"consolestyle.BgMagenta": {
input: "text with color",
act: consolestyle.BgMagenta,
expected: "\x1b[45mtext with color\x1b[49m",
},
"consolestyle.BgCyan": {
input: "text with color",
act: consolestyle.BgCyan,
expected: "\x1b[46mtext with color\x1b[49m",
},
"consolestyle.Inverse": {
input: "text with color",
act: consolestyle.Inverse,
expected: "\x1b[7mtext with color\x1b[27m",
},
})
}