-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes_test.go
More file actions
46 lines (41 loc) · 1.02 KB
/
types_test.go
File metadata and controls
46 lines (41 loc) · 1.02 KB
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
package parser
import "testing"
func TestElementTypes(t *testing.T) {
tests := []struct {
name string
et elementType
}{
{"Text", ElementTypes.Text()},
{"Link", ElementTypes.Link()},
{"Heading", ElementTypes.Heading()},
{"List", ElementTypes.List()},
{"Quote", ElementTypes.Quote()},
{"PreformatToggle", ElementTypes.PreformatToggle()},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
if actual := test.et.Name(); actual != test.name {
errorfDump(t, "name", actual, test.name)
}
})
}
}
func TestHeadingLevels(t *testing.T) {
tests := []struct {
name string
hl headingLevel
value int8
}{
{"NotHeading", HeadingLevels.NotHeading(), -1},
{"Heading", HeadingLevels.Heading(), 1},
{"SubHeading", HeadingLevels.SubHeading(), 2},
{"SubSubHeading", HeadingLevels.SubSubHeading(), 3},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
if actual := test.hl.Value(); actual != test.value {
errorfDump(t, "value", actual, test.value)
}
})
}
}