summaryrefslogtreecommitdiffstats
path: root/write_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'write_test.go')
-rw-r--r--write_test.go150
1 files changed, 77 insertions, 73 deletions
diff --git a/write_test.go b/write_test.go
index bf829a0..18809b1 100644
--- a/write_test.go
+++ b/write_test.go
@@ -108,79 +108,83 @@ content
name: "section",
args: []string{"of the"},
children: []Block{
- &TableBlock{[]Block{
- &HeaderBlock{ContentBlock{
- name: "header",
- args: []string{},
- children: []Block{
- &TextBlock{
- Contents: TextPlainContents{[]string{
- "Column 1",
- }},
- },
- &TextBlock{
- Contents: TextPlainContents{[]string{
- "Column 2",
- }},
+ &TableBlock{ContentBlock{
+ name: "table",
+ args: nil,
+ children: []Block{
+ &HeaderBlock{ContentBlock{
+ name: "header",
+ args: []string{},
+ children: []Block{
+ &TextBlock{
+ Contents: TextPlainContents{[]string{
+ "Column 1",
+ }},
+ },
+ &TextBlock{
+ Contents: TextPlainContents{[]string{
+ "Column 2",
+ }},
+ },
},
- },
- }},
- &RowBlock{ContentBlock{
- name: "row",
- args: []string{},
- children: []Block{
- &TextBlock{
- Contents: TextPlainContents{[]string{
- "CNM",
- }},
+ }},
+ &RowBlock{ContentBlock{
+ name: "row",
+ args: []string{},
+ children: []Block{
+ &TextBlock{
+ Contents: TextPlainContents{[]string{
+ "CNM",
+ }},
+ },
+ &TextBlock{
+ Contents: TextPlainContents{[]string{
+ "document",
+ "format",
+ }},
+ },
},
- &TextBlock{
- Contents: TextPlainContents{[]string{
- "document",
- "format",
+ }},
+ &RowBlock{ContentBlock{
+ name: "row",
+ args: []string{""},
+ children: []Block{
+ &SectionBlock{ContentBlock{
+ name: "section",
+ args: []string{"", "", ""},
}},
- },
- },
- }},
- &RowBlock{ContentBlock{
- name: "row",
- args: []string{""},
- children: []Block{
- &SectionBlock{ContentBlock{
- name: "section",
- args: []string{"", "", ""},
- }},
- &ListBlock{ContentBlock{
- name: "list",
- args: nil,
- children: []Block{
- &TextBlock{
- Contents: TextPlainContents{[]string{
- "ipsum",
- }},
- },
- &ListBlock{ContentBlock{
- name: "list",
- args: []string{"ordered"},
- children: []Block{
- &ListBlock{ContentBlock{
- name: "list",
- args: []string{"unordered"},
- children: []Block{
- &TextBlock{
- Contents: TextPlainContents{[]string{
- "dolor",
- "sit amet",
- }},
- },
- },
+ &ListBlock{ContentBlock{
+ name: "list",
+ args: nil,
+ children: []Block{
+ &TextBlock{
+ Contents: TextPlainContents{[]string{
+ "ipsum",
}},
},
- }},
- },
- }},
- },
- }},
+ &ListBlock{ContentBlock{
+ name: "list",
+ args: []string{"ordered"},
+ children: []Block{
+ &ListBlock{ContentBlock{
+ name: "list",
+ args: []string{"unordered"},
+ children: []Block{
+ &TextBlock{
+ Contents: TextPlainContents{[]string{
+ "dolor",
+ "sit amet",
+ }},
+ },
+ },
+ }},
+ },
+ }},
+ },
+ }},
+ },
+ }},
+ },
}},
},
}},
@@ -205,12 +209,12 @@ func TestWrite(t *testing.T) {
t.Fatalf("Write error: %v", err)
}
w := buf.String()
- t.Log("====================")
- t.Log("expected:\n" + k)
- t.Log("--------------------")
- t.Log(" got:\n" + w)
- t.Log("====================")
if k != w {
+ t.Log("====================")
+ t.Log("expected:\n" + k)
+ t.Log("--------------------")
+ t.Log(" got:\n" + w)
+ t.Log("====================")
t.Fatal("Write: output did not match expected document")
}
})