Add basic html rendering

This commit is contained in:
Niklas Fasching 2018-12-02 16:18:59 +01:00
parent 00aa120bf4
commit 6c683dfbdb
7 changed files with 402 additions and 1 deletions

20
html_test.go Normal file
View file

@ -0,0 +1,20 @@
package org
import (
"strings"
"testing"
)
func TestHTMLWriter(t *testing.T) {
for _, path := range orgTestFiles() {
reader, writer := strings.NewReader(fileString(path)), NewHTMLWriter()
actual := NewDocument().Parse(reader).Write(writer).String()
expected := fileString(path[:len(path)-len(".org")] + ".html")
if expected != actual {
t.Errorf("%s:\n%s'", path, diff(actual, expected))
} else {
t.Logf("%s: passed!", path)
}
}
}