Until now we expected the .org file to print back to itself - we can't do that when the input is not pretty printed already - with the introduction of blocks with unindented content that will be the case.
23 lines
543 B
Go
23 lines
543 B
Go
package org
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestHTMLWriter(t *testing.T) {
|
|
for _, path := range orgTestFiles() {
|
|
expected := fileString(path[:len(path)-len(".org")] + ".html")
|
|
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
|
|
}
|
|
if actual != expected {
|
|
t.Errorf("%s:\n%s'", path, diff(actual, expected))
|
|
} else {
|
|
t.Logf("%s: passed!", path)
|
|
}
|
|
}
|
|
}
|