-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi_test.go
More file actions
43 lines (38 loc) · 817 Bytes
/
api_test.go
File metadata and controls
43 lines (38 loc) · 817 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
package chisel
import "testing"
func TestLanguageConstants(t *testing.T) {
tests := []struct {
lang Language
want string
}{
{Go, "go"},
{TypeScript, "typescript"},
{JavaScript, "javascript"},
{Python, "python"},
{Rust, "rust"},
{Markdown, "markdown"},
}
for _, tt := range tests {
if string(tt.lang) != tt.want {
t.Errorf("Language %v = %q, want %q", tt.lang, string(tt.lang), tt.want)
}
}
}
func TestKindConstants(t *testing.T) {
tests := []struct {
kind Kind
want string
}{
{KindFunction, "function"},
{KindMethod, "method"},
{KindClass, "class"},
{KindType, "type"},
{KindSection, "section"},
{KindModule, "module"},
}
for _, tt := range tests {
if string(tt.kind) != tt.want {
t.Errorf("Kind %v = %q, want %q", tt.kind, string(tt.kind), tt.want)
}
}
}