-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerator_test.go
More file actions
36 lines (30 loc) · 885 Bytes
/
generator_test.go
File metadata and controls
36 lines (30 loc) · 885 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
package parser
import (
"os"
"testing"
)
func TestToGemtext(t *testing.T) {
parsedInput, _ := ParseFile("testdata/input.gmi")
actual := ToGemtext(parsedInput)
expectedOutput, _ := os.ReadFile("testdata/output.gmi")
expected := string(expectedOutput)
if actual != expected {
errorfRaw(t, "gemtext", actual, expected)
}
}
func TestToHTML(t *testing.T) {
parsedInput, _ := ParseFile("testdata/input.gmi")
actual := ToHTML(parsedInput)
expectedOutput, _ := os.ReadFile("testdata/output.html")
expected := string(expectedOutput)
if actual != expected {
errorfRaw(t, "html", actual, expected)
}
parsedInput, _ = ParseFile("testdata/input_list_only.gmi")
actual = ToHTML(parsedInput)
expectedOutput, _ = os.ReadFile("testdata/output_list_only.html")
expected = string(expectedOutput)
if actual != expected {
errorfRaw(t, "html_listOnly", actual, expected)
}
}