go-org-orgwiki/org/html_test.go
Niklas Fasching 2947d7632d Support basic #+INCLUDE (src/example/export block only)
including org files is more complex - e.g. footnotes need to be namespaced to
their source file. org does this by prefixing each included files footnotes
with a number - but even that is not enough as it doesn't guarantee
uniqueness.

As I don't have a usecase for it, I'll avoid the additional complexity for
now.
2018-12-14 17:09:00 +01:00

23 lines
543 B
Go

package org
import (
"strings"
"testing"
)
func TestHTMLWriter(t *testing.T) {
for _, path := range orgTestFiles() {
reader, writer := strings.NewReader(fileString(path)), NewHTMLWriter()
actual, err := NewDocument().SetPath(path).Parse(reader).Write(writer)
if err != nil {
t.Errorf("%s\n got error: %s", path, err)
continue
}
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)
}
}
}