-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmod_test.go
More file actions
57 lines (51 loc) · 918 Bytes
/
mod_test.go
File metadata and controls
57 lines (51 loc) · 918 Bytes
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
package termtools
import (
"testing"
)
func PrintPalette(width int) {
}
func Test_BasicColors(t *testing.T) {
var p Printer
p.Println("Testing basic colors output")
width := 4
for color := range colorMap {
if width == 0 {
p.Println()
width = 4
}
p.SetColor(color)
p.Printf("[%v] ", color)
p.Reset()
width--
}
p.Print("\n\n")
}
func Test_ColorOutput(t *testing.T) {
p := Printer{}
p.Println("These are color codes to set up colors by id...")
start, width := 0, 20
for start < 256 {
end := start + width
if end > 256 {
end = 256
}
for id := start; id < end; id++ {
p.Printf("%3d ", id)
}
p.Println()
for id := start; id < end; id++ {
p.SetBackground(id)
p.Printf(" ")
p.Reset()
p.Print(" ")
}
start = end
p.Println()
}
}
func Test_BlinkingMode(t *testing.T) {
p := Printer{}
p.SetColor(9)
p.ToggleBlinking()
p.Println("Thats all folks!")
}