-
Notifications
You must be signed in to change notification settings - Fork 20
/
colorscheme_test.go
240 lines (231 loc) · 5.32 KB
/
colorscheme_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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
package main
import (
"reflect"
"testing"
)
func TestBase16Colorscheme_MustacheContext(t *testing.T) {
type fields struct {
Name string
Author string
Color00 string
Color01 string
Color02 string
Color03 string
Color04 string
Color05 string
Color06 string
Color07 string
Color08 string
Color09 string
Color10 string
Color11 string
Color12 string
Color13 string
Color14 string
Color15 string
RepoURL string
RawBaseURL string
FileName string
}
tests := []struct {
name string
fields fields
want map[string]interface{}
}{
// TODO: Add test cases.
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
s := Base16Colorscheme{
Name: tt.fields.Name,
Author: tt.fields.Author,
Color00: tt.fields.Color00,
Color01: tt.fields.Color01,
Color02: tt.fields.Color02,
Color03: tt.fields.Color03,
Color04: tt.fields.Color04,
Color05: tt.fields.Color05,
Color06: tt.fields.Color06,
Color07: tt.fields.Color07,
Color08: tt.fields.Color08,
Color09: tt.fields.Color09,
Color10: tt.fields.Color10,
Color11: tt.fields.Color11,
Color12: tt.fields.Color12,
Color13: tt.fields.Color13,
Color14: tt.fields.Color14,
Color15: tt.fields.Color15,
RepoURL: tt.fields.RepoURL,
RawBaseURL: tt.fields.RawBaseURL,
FileName: tt.fields.FileName,
}
if got := s.MustacheContext(".config"); !reflect.DeepEqual(got, tt.want) {
t.Errorf("Base16Colorscheme.MustacheContext() = %v, want %v", got, tt.want)
}
})
}
}
func TestBase16ColorschemeList_GetBase16Colorscheme(t *testing.T) {
type fields struct {
colorschemes map[string]string
}
type args struct {
name string
}
tests := []struct {
name string
fields fields
args args
want Base16Colorscheme
wantErr bool
}{
// TODO: Add test cases.
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
l := &Base16ColorschemeList{
colorschemes: tt.fields.colorschemes,
}
got, err := l.GetBase16Colorscheme(tt.args.name)
if (err != nil) != tt.wantErr {
t.Errorf("Base16ColorschemeList.GetBase16Colorscheme() error = %v, wantErr %v", err, tt.wantErr)
return
}
if !reflect.DeepEqual(got, tt.want) {
t.Errorf("Base16ColorschemeList.GetBase16Colorscheme() = %v, want %v", got, tt.want)
}
})
}
}
func TestNewBase16Colorscheme(t *testing.T) {
data1 := `scheme: "Atelier Forest"
author: "Bram de Haan (http://atelierbramdehaan.nl)"
base00: "1b1918"
base01: "2c2421"
base02: "68615e"
base03: "766e6b"
base04: "9c9491"
base05: "a8a19f"
base06: "e6e2e0"
base07: "f1efee"
base08: "f22c40"
base09: "df5320"
base0A: "c38418"
base0B: "7b9726"
base0C: "3d97b8"
base0D: "407ee7"
base0E: "6666ea"
base0F: "c33ff3"`
want1 := Base16Colorscheme{
Name: "Atelier Forest",
Author: "Bram de Haan (http://atelierbramdehaan.nl)",
Color00: "1b1918",
Color01: "2c2421",
Color02: "68615e",
Color03: "766e6b",
Color04: "9c9491",
Color05: "a8a19f",
Color06: "e6e2e0",
Color07: "f1efee",
Color08: "f22c40",
Color09: "df5320",
Color10: "c38418",
Color11: "7b9726",
Color12: "3d97b8",
Color13: "407ee7",
Color14: "6666ea",
Color15: "c33ff3",
RepoURL: "",
RawBaseURL: "",
}
tests := []struct {
name string
yamlData string
want Base16Colorscheme
}{
{"Parse atelier-forest theme", data1, want1},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := NewBase16Colorscheme(tt.yamlData); !reflect.DeepEqual(got, tt.want) {
t.Errorf("NewBase16Colorscheme() = %v, want %v", got, tt.want)
}
})
}
}
func TestLoadBase16ColorschemeList(t *testing.T) {
tests := []struct {
name string
want Base16ColorschemeList
}{
// TODO: Add test cases.
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := LoadBase16ColorschemeList(); !reflect.DeepEqual(got, tt.want) {
t.Errorf("LoadBase16ColorschemeList() = %v, want %v", got, tt.want)
}
})
}
}
func TestSaveBase16ColorschemeList(t *testing.T) {
type args struct {
l Base16ColorschemeList
}
tests := []struct {
name string
args args
}{
// TODO: Add test cases.
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
SaveBase16ColorschemeList(tt.args.l)
})
}
}
func TestBase16ColorschemeList_UpdateSchemes(t *testing.T) {
type fields struct {
colorschemes map[string]string
}
tests := []struct {
name string
fields fields
}{
// TODO: Add test cases.
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
l := &Base16ColorschemeList{
colorschemes: tt.fields.colorschemes,
}
l.UpdateSchemes()
})
}
}
func TestBase16ColorschemeList_Find(t *testing.T) {
type fields struct {
colorschemes map[string]string
}
type args struct {
input string
}
tests := []struct {
name string
fields fields
args args
want Base16Colorscheme
}{
// TODO: Add test cases.
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
c := &Base16ColorschemeList{
colorschemes: tt.fields.colorschemes,
}
if got := c.Find(tt.args.input); !reflect.DeepEqual(got, tt.want) {
t.Errorf("Base16ColorschemeList.Find() = %v, want %v", got, tt.want)
}
})
}
}