-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy paththeme_test.go
108 lines (104 loc) · 1.35 KB
/
theme_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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
package prettyfyne
import (
"fmt"
"testing"
)
func TestPrettyTheme_MarshalYaml(t *testing.T) {
pt := DefaultTheme()
y, err := pt.MarshalYaml()
if err != nil {
t.Error(err)
} else {
fmt.Println(string(y))
}
}
func TestUnmarshalYaml(t *testing.T) {
yt := `background_color:
r: 66
g: 66
b: 66
a: 255
button_color:
r: 33
g: 33
b: 33
a: 255
disabled_button_color:
r: 49
g: 49
b: 49
a: 255
hyperlink_color:
r: 153
g: 153
b: 255
a: 255
text_color:
r: 255
g: 255
b: 255
a: 255
disabled_text_color:
r: 96
g: 96
b: 96
a: 255
icon_color:
r: 255
g: 255
b: 255
a: 255
disabled_icon_color:
r: 96
g: 96
b: 96
a: 255
place_holder_color:
r: 178
g: 178
b: 178
a: 255
primary_color:
r: 26
g: 35
b: 126
a: 255
hover_color:
r: 49
g: 49
b: 49
a: 255
focus_color:
r: 26
g: 35
b: 126
a: 255
scroll_bar_color:
r: 0
g: 0
b: 0
a: 153
shadow_color:
r: 0
g: 0
b: 0
a: 102
text_size: 14
text_font: NotoSans-Regular.ttf
text_bold_font: NotoSans-Bold.ttf
text_italic_font: NotoSans-Italic.ttf
text_bold_italic_font: NotoSans-BoldItalic.ttf
text_monospace_font: NotoMono-Regular.ttf
padding: 4
icon_inline_size: 20
scroll_bar_size: 16
scroll_bar_small_size: 3
`
_, ok, err := UnmarshalYaml([]byte(yt))
if err != nil {
t.Error(err)
}
if !ok {
t.Error("didn't load fonts!")
}
}