Improve tests: Add pretty_org fixtures to allow testing pretty printing
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.
This commit is contained in:
parent
c26d39284c
commit
ade2a1c875
14 changed files with 356 additions and 8 deletions
|
@ -12,8 +12,8 @@ import (
|
|||
|
||||
func TestOrgWriter(t *testing.T) {
|
||||
for _, path := range orgTestFiles() {
|
||||
expected := fileString(path)
|
||||
reader, writer := strings.NewReader(expected), NewOrgWriter()
|
||||
expected := fileString(path[:len(path)-len(".org")] + ".pretty_org")
|
||||
reader, writer := strings.NewReader(fileString(path)), NewOrgWriter()
|
||||
actual, err := NewDocument().SetPath(path).Parse(reader).Write(writer)
|
||||
if err != nil {
|
||||
t.Errorf("%s\n got error: %s", path, err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue