diff --git a/pkg/parser/blank_line_test.go b/pkg/parser/blank_line_test.go index c888a821..b573a32f 100644 --- a/pkg/parser/blank_line_test.go +++ b/pkg/parser/blank_line_test.go @@ -31,7 +31,7 @@ second paragraph` }, }, } - verifyPreflight(expected, doc) + verifyPreflight("test.adoc", expected, doc) }) It("blank line with spaces and tabs between 2 paragraphs and after second paragraph", func() { doc := `first paragraph @@ -63,7 +63,7 @@ second paragraph }, }, } - verifyPreflight(expected, doc) + verifyPreflight("test.adoc", expected, doc) }) }) diff --git a/pkg/parser/comment_test.go b/pkg/parser/comment_test.go index 5f2360db..89bd5ac1 100644 --- a/pkg/parser/comment_test.go +++ b/pkg/parser/comment_test.go @@ -150,7 +150,7 @@ a second paragraph` }, }, } - verifyPreflight(expected, doc) + verifyPreflight("test.adoc", expected, doc) }) }) diff --git a/pkg/parser/cross_reference_test.go b/pkg/parser/cross_reference_test.go index debb2e18..e6bf9bc7 100644 --- a/pkg/parser/cross_reference_test.go +++ b/pkg/parser/cross_reference_test.go @@ -49,7 +49,7 @@ with some content linked to <>!` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("cross-reference with custom id and label", func() { @@ -92,7 +92,7 @@ with some content linked to <>!` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) }) }) diff --git a/pkg/parser/delimited_block_test.go b/pkg/parser/delimited_block_test.go index 5c7b8475..001e8909 100644 --- a/pkg/parser/delimited_block_test.go +++ b/pkg/parser/delimited_block_test.go @@ -124,7 +124,7 @@ var _ = Describe("delimited blocks - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("fenced block after a paragraph", func() { @@ -158,7 +158,7 @@ var _ = Describe("delimited blocks - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("fenced block with unclosed delimiter", func() { @@ -424,7 +424,7 @@ then a normal paragraph.` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("listing block just after a paragraph", func() { @@ -460,7 +460,7 @@ some listing code }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("listing block with unclosed delimiter", func() { @@ -722,7 +722,7 @@ paragraphs }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) }) diff --git a/pkg/parser/document_preprocessing.go b/pkg/parser/document_preprocessing.go index 11e4d609..be81dc31 100644 --- a/pkg/parser/document_preprocessing.go +++ b/pkg/parser/document_preprocessing.go @@ -52,7 +52,7 @@ func parseElements(filename string, elements []interface{}, attrs types.Document result = append(result, e) case types.FileInclusion: // read the file and include its content - embedded, err := parseFileToInclude(e, attrs, opts...) + embedded, err := parseFileToInclude(filename, e, attrs, opts...) if err != nil { // do not fail, but instead report the error in the console log.Errorf("failed to include file '%s': %v", e.Location, err) @@ -91,16 +91,24 @@ var invalidFileTmpl *template.Template func init() { var err error - invalidFileTmpl, err = template.New("invalid file to include").Parse(`Unresolved directive in test.adoc - {{ . }}`) + invalidFileTmpl, err = template.New("invalid file to include").Parse(`Unresolved directive in {{ .Filename }} - {{ .Error }}`) if err != nil { log.Fatalf("failed to initialize template: %v", err) } } -func invalidFileErrMsg(path, rawText string, err error) (types.PreflightDocument, error) { +type invalidFileData struct { + Filename string + Error string +} + +func invalidFileErrMsg(filename, path, rawText string, err error) (types.PreflightDocument, error) { log.WithError(err).Errorf("failed to include '%s'", path) buf := bytes.NewBuffer(nil) - err = invalidFileTmpl.Execute(buf, rawText) + err = invalidFileTmpl.Execute(buf, invalidFileData{ + Filename: filename, + Error: rawText, + }) if err != nil { return types.PreflightDocument{}, err } @@ -120,31 +128,31 @@ func invalidFileErrMsg(path, rawText string, err error) (types.PreflightDocument }, nil } -func parseFileToInclude(incl types.FileInclusion, attrs types.DocumentAttributes, opts ...Option) (types.PreflightDocument, error) { +func parseFileToInclude(filename string, incl types.FileInclusion, attrs types.DocumentAttributes, opts ...Option) (types.PreflightDocument, error) { path := incl.Location.Resolve(attrs) log.Debugf("parsing '%s'...", path) f, absPath, done, err := open(path) defer done() if err != nil { - return invalidFileErrMsg(path, incl.RawText, err) + return invalidFileErrMsg(filename, path, incl.RawText, err) } content := bytes.NewBuffer(nil) scanner := bufio.NewScanner(bufio.NewReader(f)) if lineRanges, ok := incl.LineRanges(); ok { if err := readWithinLines(scanner, content, lineRanges); err != nil { - return invalidFileErrMsg(path, incl.RawText, err) + return invalidFileErrMsg(filename, path, incl.RawText, err) } } else if tagRanges, ok := incl.TagRanges(); ok { if err := readWithinTags(scanner, content, tagRanges); err != nil { - return invalidFileErrMsg(path, incl.RawText, err) + return invalidFileErrMsg(filename, path, incl.RawText, err) } } else { if err := readAll(scanner, content); err != nil { - return invalidFileErrMsg(path, incl.RawText, err) + return invalidFileErrMsg(filename, path, incl.RawText, err) } } if err := scanner.Err(); err != nil { - msg, err2 := invalidFileErrMsg(path, incl.RawText, err) + msg, err2 := invalidFileErrMsg(filename, path, incl.RawText, err) if err2 != nil { return types.PreflightDocument{}, err2 } diff --git a/pkg/parser/file_inclusion_test.go b/pkg/parser/file_inclusion_test.go index efd949b1..4f33ed03 100644 --- a/pkg/parser/file_inclusion_test.go +++ b/pkg/parser/file_inclusion_test.go @@ -114,7 +114,7 @@ var _ = Describe("file inclusions - preflight with preprocessing", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("should include adoc file with leveloffset", func() { @@ -147,7 +147,7 @@ var _ = Describe("file inclusions - preflight with preprocessing", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) Context("file inclusions in delimited blocks", func() { @@ -187,7 +187,7 @@ var _ = Describe("file inclusions - preflight with preprocessing", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("should include adoc file within listing block", func() { @@ -225,7 +225,7 @@ include::../../test/includes/chapter-a.adoc[] }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("should include adoc file within example block", func() { @@ -263,7 +263,7 @@ include::../../test/includes/chapter-a.adoc[] }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("should include adoc file within quote block", func() { @@ -301,7 +301,7 @@ ____` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("should include adoc file within verse block", func() { @@ -342,7 +342,7 @@ ____` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("should include adoc file within sidebar block", func() { @@ -380,7 +380,7 @@ include::../../test/includes/chapter-a.adoc[] }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("should include adoc file within passthrough block", func() { @@ -415,7 +415,7 @@ include::../../test/includes/chapter-a.adoc[] }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) }) @@ -442,7 +442,7 @@ include::../../test/includes/chapter-a.adoc[] }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("file inclusion with multiple unquoted lines", func() { @@ -465,7 +465,7 @@ include::../../test/includes/chapter-a.adoc[] types.BlankLine{}, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("file inclusion with multiple unquoted ranges", func() { @@ -492,7 +492,7 @@ include::../../test/includes/chapter-a.adoc[] }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("file inclusion with invalid unquoted range - case 1", func() { @@ -525,7 +525,7 @@ include::../../test/includes/chapter-a.adoc[] }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("file inclusion with invalid unquoted range - case 2", func() { @@ -547,7 +547,7 @@ include::../../test/includes/chapter-a.adoc[] }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) }) @@ -572,7 +572,7 @@ include::../../test/includes/chapter-a.adoc[] }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("file inclusion with multiple quoted lines", func() { @@ -595,7 +595,7 @@ include::../../test/includes/chapter-a.adoc[] types.BlankLine{}, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("file inclusion with multiple quoted ranges", func() { @@ -623,7 +623,7 @@ include::../../test/includes/chapter-a.adoc[] }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("file inclusion with invalid quoted range - case 1", func() { @@ -656,7 +656,7 @@ include::../../test/includes/chapter-a.adoc[] }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("file inclusion with invalid quoted range - case 2", func() { @@ -689,7 +689,7 @@ include::../../test/includes/chapter-a.adoc[] }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("file inclusion with ignored tags", func() { @@ -712,7 +712,7 @@ include::../../test/includes/chapter-a.adoc[] }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) }) }) @@ -738,7 +738,7 @@ include::../../test/includes/chapter-a.adoc[] }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("file inclusion with surrounding tag", func() { @@ -773,7 +773,7 @@ include::../../test/includes/chapter-a.adoc[] types.BlankLine{}, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("file inclusion with unclosed tag", func() { @@ -805,7 +805,7 @@ include::../../test/includes/chapter-a.adoc[] }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("file inclusion with unknown tag", func() { @@ -815,7 +815,7 @@ include::../../test/includes/chapter-a.adoc[] Blocks: []interface{}{}, } // when/then - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("file inclusion with no tag", func() { @@ -861,7 +861,7 @@ include::../../test/includes/chapter-a.adoc[] }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) }) @@ -872,7 +872,6 @@ include::../../test/includes/chapter-a.adoc[] // setup logger to write in a buffer so we can check the output console, reset := configureLogger() defer reset() - source := `include::{unknown}/unknown.adoc[leveloffset=+1]` expected := types.PreflightDocument{ Blocks: []interface{}{ @@ -881,14 +880,14 @@ include::../../test/includes/chapter-a.adoc[] Lines: []types.InlineElements{ { types.StringElement{ - Content: "Unresolved directive in test.adoc - include::{unknown}/unknown.adoc[leveloffset=+1]", + Content: "Unresolved directive in foo.adoc - include::{unknown}/unknown.adoc[leveloffset=+1]", }, }, }, }, }, } - verifyPreflight(expected, source) + verifyPreflight("foo.adoc", expected, source) // verify error in logs verifyConsoleOutput(console, "failed to include '{unknown}/unknown.adoc'") @@ -907,14 +906,14 @@ include::../../test/includes/chapter-a.adoc[] Lines: []types.InlineElements{ { types.StringElement{ - Content: "Unresolved directive in test.adoc - include::../../test/includes/unknown.adoc[leveloffset=+1]", + Content: "Unresolved directive in foo.adoc - include::../../test/includes/unknown.adoc[leveloffset=+1]", }, }, }, }, }, } - verifyPreflight(expected, source) + verifyPreflight("foo.adoc", expected, source) // verify error in logs verifyConsoleOutput(console, "failed to include '../../test/includes/unknown.adoc'") }) @@ -938,7 +937,7 @@ include::../../test/includes/unknown.adoc[leveloffset=+1] Lines: []types.InlineElements{ { types.StringElement{ - Content: "Unresolved directive in test.adoc - include::../../test/includes/unknown.adoc[leveloffset=+1]", + Content: "Unresolved directive in foo.adoc - include::../../test/includes/unknown.adoc[leveloffset=+1]", }, }, }, @@ -947,7 +946,7 @@ include::../../test/includes/unknown.adoc[leveloffset=+1] }, }, } - verifyPreflight(expected, source) + verifyPreflight("foo.adoc", expected, source) // verify error in logs verifyConsoleOutput(console, "failed to include '../../test/includes/unknown.adoc'") }) @@ -989,7 +988,7 @@ include::{includedir}/grandchild-include.adoc[]` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("should resolve path with attribute in delimited block", func() { @@ -1034,7 +1033,7 @@ include::{includedir}/grandchild-include.adoc[] }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) }) @@ -1097,7 +1096,7 @@ include::../../test/includes/hello_world.go.txt[] }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) }) }) diff --git a/pkg/parser/footnote_test.go b/pkg/parser/footnote_test.go index e6e3f7c8..f92c1716 100644 --- a/pkg/parser/footnote_test.go +++ b/pkg/parser/footnote_test.go @@ -41,7 +41,7 @@ var _ = Describe("footnotes - preflight", func() { }, }, } - verifyPreflight(expected, source) // need to get the whole document here + verifyPreflight("test.adoc", expected, source) // need to get the whole document here }) It("footnote with single-line rich content", func() { @@ -94,7 +94,7 @@ var _ = Describe("footnotes - preflight", func() { }, }, } - verifyPreflight(expected, source) // need to get the whole document here + verifyPreflight("test.adoc", expected, source) // need to get the whole document here }) It("footnote in a paragraph", func() { @@ -121,7 +121,7 @@ var _ = Describe("footnotes - preflight", func() { }, }, } - verifyPreflight(expected, source) // need to get the whole document here + verifyPreflight("test.adoc", expected, source) // need to get the whole document here }) }) @@ -168,7 +168,7 @@ var _ = Describe("footnotes - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("footnoteref with unknown reference", func() { @@ -212,7 +212,7 @@ var _ = Describe("footnotes - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) }) @@ -313,7 +313,7 @@ a paragraph with another footnote:[baz]` }, }, } - verifyPreflight(expected, source) // need to get the whole document here + verifyPreflight("test.adoc", expected, source) // need to get the whole document here }) }) diff --git a/pkg/parser/frontmatter_test.go b/pkg/parser/frontmatter_test.go index 17e1efd3..b6dc839f 100644 --- a/pkg/parser/frontmatter_test.go +++ b/pkg/parser/frontmatter_test.go @@ -35,7 +35,7 @@ first paragraph` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("empty front-matter", func() { @@ -59,7 +59,7 @@ first paragraph` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) }) diff --git a/pkg/parser/image_test.go b/pkg/parser/image_test.go index 9aa4c329..94076f7a 100644 --- a/pkg/parser/image_test.go +++ b/pkg/parser/image_test.go @@ -121,7 +121,7 @@ image::appa.png[]` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) }) @@ -162,7 +162,7 @@ image::appa.png[]` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) }) }) diff --git a/pkg/parser/labeled_list_test.go b/pkg/parser/labeled_list_test.go index f5bab1d3..02a636d6 100644 --- a/pkg/parser/labeled_list_test.go +++ b/pkg/parser/labeled_list_test.go @@ -33,7 +33,7 @@ on 2 lines` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("labeled list with a single term and no description", func() { @@ -48,7 +48,7 @@ on 2 lines` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("labeled list with a horizontal layout attribute", func() { @@ -75,7 +75,7 @@ Item1:: foo` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("labeled list with a single term and a blank line", func() { @@ -91,7 +91,7 @@ Item1:: foo` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("labeled list with multiple sibling items", func() { @@ -150,7 +150,7 @@ Item 3 description` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("labeled list with multiple nested items", func() { @@ -209,7 +209,7 @@ Item 3 description` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("labeled list with nested unordered list - case 1", func() { @@ -275,7 +275,7 @@ Item with description:: something simple` }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("labeled list with a single item and paragraph", func() { @@ -315,7 +315,7 @@ a normal paragraph.` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("labeled list with item continuation", func() { @@ -394,7 +394,7 @@ another fenced block }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("labeled list without item continuation", func() { @@ -463,7 +463,7 @@ another fenced block }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("labeled list with nested unordered list - case 2", func() { @@ -495,7 +495,7 @@ another fenced block }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("labeled list with title", func() { @@ -542,7 +542,7 @@ second term:: definition of the second term` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("max level of labeled items - case 1", func() { @@ -625,7 +625,7 @@ level 1:: description 1` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("max level of labeled items - case 2", func() { @@ -708,7 +708,7 @@ level 2::: description 2` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) }) diff --git a/pkg/parser/literal_block_test.go b/pkg/parser/literal_block_test.go index 18385844..838c616c 100644 --- a/pkg/parser/literal_block_test.go +++ b/pkg/parser/literal_block_test.go @@ -72,7 +72,7 @@ a normal paragraph.` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) }) @@ -128,7 +128,7 @@ a normal paragraph.` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) }) @@ -161,7 +161,7 @@ a normal paragraph.` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("literal block from 2-lines paragraph with attribute", func() { @@ -198,7 +198,7 @@ a normal paragraph.` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) }) diff --git a/pkg/parser/ordered_list_test.go b/pkg/parser/ordered_list_test.go index 4209625b..b826ae97 100644 --- a/pkg/parser/ordered_list_test.go +++ b/pkg/parser/ordered_list_test.go @@ -33,7 +33,7 @@ var _ = Describe("ordered lists - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("ordered list item with arabic numbering style", func() { @@ -48,7 +48,7 @@ var _ = Describe("ordered lists - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("ordered list item with lower alpha numbering style", func() { @@ -63,7 +63,7 @@ var _ = Describe("ordered lists - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("ordered list item with upper alpha numbering style", func() { @@ -78,7 +78,7 @@ var _ = Describe("ordered lists - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("ordered list item with lower roman numbering style", func() { @@ -93,7 +93,7 @@ var _ = Describe("ordered lists - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("ordered list item with upper roman numbering style", func() { @@ -108,7 +108,7 @@ var _ = Describe("ordered lists - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("ordered list item with explicit numbering style", func() { @@ -133,7 +133,7 @@ var _ = Describe("ordered lists - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("ordered list item with explicit start only", func() { @@ -151,7 +151,7 @@ var _ = Describe("ordered lists - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("ordered list item with explicit quoted numbering and start", func() { @@ -170,7 +170,7 @@ var _ = Describe("ordered lists - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("max level of ordered items - case 1", func() { @@ -289,7 +289,7 @@ var _ = Describe("ordered lists - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("max level of ordered items - case 2", func() { @@ -408,7 +408,7 @@ var _ = Describe("ordered lists - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) }) @@ -452,7 +452,7 @@ var _ = Describe("ordered lists - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("ordered list with unnumbered items", func() { @@ -493,7 +493,7 @@ var _ = Describe("ordered lists - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("ordered list with custom numbering on child items with tabs ", func() { @@ -618,7 +618,7 @@ var _ = Describe("ordered lists - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("ordered list with all default styles and blank lines", func() { @@ -723,7 +723,7 @@ var _ = Describe("ordered lists - preflight", func() { types.BlankLine{}, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) }) @@ -766,7 +766,7 @@ var _ = Describe("ordered lists - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("ordered list with numbered items", func() { @@ -838,7 +838,7 @@ b. item 2.a` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) }) @@ -928,7 +928,7 @@ another delimited block }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) }) }) diff --git a/pkg/parser/paragraph_test.go b/pkg/parser/paragraph_test.go index 30c13c31..e91064a1 100644 --- a/pkg/parser/paragraph_test.go +++ b/pkg/parser/paragraph_test.go @@ -328,7 +328,7 @@ And no space after [CAUTION] either.` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) }) diff --git a/pkg/parser/parser_test.go b/pkg/parser/parser_test.go index bcddbd2c..7386ba7a 100644 --- a/pkg/parser/parser_test.go +++ b/pkg/parser/parser_test.go @@ -21,10 +21,10 @@ func verifyDocument(expected interface{}, content string) { assert.EqualValues(GinkgoT(), expected, preflightDoc) } -func verifyPreflight(expected interface{}, content string) { - log.Debugf("processing: %s", content) +func verifyPreflight(filename string, expected interface{}, content string) { + log.Debugf("processing %s: %s", filename, content) r := strings.NewReader(content) - preflightDoc, err := parser.ParsePreflightDocument("", r) + preflightDoc, err := parser.ParsePreflightDocument(filename, r) require.NoError(GinkgoT(), err) GinkgoT().Logf("actual document: `%s`", spew.Sdump(preflightDoc)) GinkgoT().Logf("expected document: `%s`", spew.Sdump(expected)) diff --git a/pkg/parser/quoted_text_test.go b/pkg/parser/quoted_text_test.go index 36c8d47e..c8268da3 100644 --- a/pkg/parser/quoted_text_test.go +++ b/pkg/parser/quoted_text_test.go @@ -28,7 +28,7 @@ var _ = Describe("quoted texts - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("bold text with 2 words", func() { @@ -50,7 +50,7 @@ var _ = Describe("quoted texts - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("bold text with 3 words", func() { @@ -72,7 +72,7 @@ var _ = Describe("quoted texts - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("italic text with 3 words in single quote", func() { @@ -94,7 +94,7 @@ var _ = Describe("quoted texts - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("monospace text with 3 words", func() { @@ -116,7 +116,7 @@ var _ = Describe("quoted texts - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("invalid subscript text with 3 words", func() { @@ -171,7 +171,7 @@ var _ = Describe("quoted texts - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("monospace text within bold text within italic quote", func() { @@ -205,7 +205,7 @@ var _ = Describe("quoted texts - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("italic text within italic text", func() { @@ -303,7 +303,7 @@ var _ = Describe("quoted texts - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("italic text with 3 words in double quote", func() { @@ -325,7 +325,7 @@ var _ = Describe("quoted texts - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("monospace text with 3 words in double quote", func() { @@ -347,7 +347,7 @@ var _ = Describe("quoted texts - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("superscript text within italic text", func() { @@ -376,7 +376,7 @@ var _ = Describe("quoted texts - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("superscript text within italic text within bold quote", func() { @@ -410,7 +410,7 @@ var _ = Describe("quoted texts - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) }) diff --git a/pkg/parser/section_test.go b/pkg/parser/section_test.go index cbb76865..74967727 100644 --- a/pkg/parser/section_test.go +++ b/pkg/parser/section_test.go @@ -27,7 +27,7 @@ var _ = Describe("sections - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("header with many spaces around content", func() { @@ -48,7 +48,7 @@ var _ = Describe("sections - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("header and paragraph", func() { @@ -81,7 +81,7 @@ and a paragraph` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("two sections with level 0", func() { @@ -118,7 +118,7 @@ and a paragraph` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("section level 1 alone", func() { @@ -139,7 +139,7 @@ and a paragraph` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("section level 1 with quoted text", func() { @@ -165,7 +165,7 @@ and a paragraph` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("section level 0 with nested section level 1", func() { @@ -201,7 +201,7 @@ and a paragraph` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("section level 0 with nested section level 2", func() { @@ -237,7 +237,7 @@ and a paragraph` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("section level 1 with immediate paragraph", func() { @@ -267,7 +267,7 @@ and a paragraph` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("section level 1 with a paragraph separated by empty line", func() { @@ -299,7 +299,7 @@ and a paragraph` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("section level 1 with a paragraph separated by non-empty line", func() { @@ -329,7 +329,7 @@ and a paragraph` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("section levels 1, 2, 3, 2", func() { @@ -418,7 +418,7 @@ a paragraph` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("single section with custom IDs", func() { @@ -440,7 +440,7 @@ a paragraph` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("multiple sections with custom IDs", func() { @@ -502,7 +502,7 @@ a paragraph` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("sections with same title", func() { @@ -538,7 +538,7 @@ a paragraph` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) }) @@ -556,7 +556,7 @@ a paragraph` }, }, }} - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("header invalid - header space", func() { @@ -574,7 +574,7 @@ a paragraph` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("header with invalid section1", func() { @@ -607,7 +607,7 @@ a paragraph` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) }) @@ -642,7 +642,7 @@ Doc Writer ` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) }) }) diff --git a/pkg/parser/unordered_list_test.go b/pkg/parser/unordered_list_test.go index 9b8ecb32..cdae39a8 100644 --- a/pkg/parser/unordered_list_test.go +++ b/pkg/parser/unordered_list_test.go @@ -31,7 +31,7 @@ var _ = Describe("unordered lists - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("unordered list with ID, title, role and a single item", func() { @@ -64,7 +64,7 @@ var _ = Describe("unordered lists - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("unordered list with a title and a single item", func() { source := `.a title @@ -91,7 +91,7 @@ var _ = Describe("unordered lists - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("unordered list with 2 items with stars", func() { @@ -139,7 +139,7 @@ var _ = Describe("unordered lists - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("unordered list based on article.adoc (with heading spaces)", func() { @@ -286,7 +286,7 @@ var _ = Describe("unordered lists - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("unordered list with 2 items with carets", func() { @@ -334,7 +334,7 @@ var _ = Describe("unordered lists - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("unordered list with items with mixed styles", func() { @@ -427,7 +427,7 @@ var _ = Describe("unordered lists - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("unordered list with 2 items with empty line in-between", func() { @@ -478,7 +478,7 @@ var _ = Describe("unordered lists - preflight", func() { }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("unordered list with 2 items on multiple lines", func() { source := `* item 1 @@ -527,7 +527,7 @@ on 2 lines, too.` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("unordered lists with 2 empty lines in-between", func() { source := `* an item in the first list @@ -572,7 +572,7 @@ on 2 lines, too.` }, }, } - verifyPreflight(expected, source) // parse the whole document to get 2 lists + verifyPreflight("test.adoc", expected, source) // parse the whole document to get 2 lists }) It("unordered list with items on 3 levels", func() { @@ -716,7 +716,7 @@ on 2 lines, too.` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("max level of unordered items - case 1", func() { @@ -841,7 +841,7 @@ on 2 lines, too.` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("max level of unordered items - case 2", func() { @@ -965,7 +965,7 @@ on 2 lines, too.` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) }) @@ -1060,7 +1060,7 @@ on 2 lines, too.` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("invalid list item", func() { @@ -1077,7 +1077,7 @@ on 2 lines, too.` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) }) @@ -1169,7 +1169,7 @@ another delimited block }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("unordered list with item continuation - case 2", func() { @@ -1325,7 +1325,7 @@ The {plus} symbol is on a new line. }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("unordered list without item continuation", func() { @@ -1405,7 +1405,7 @@ another delimited block }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) }) @@ -1482,7 +1482,7 @@ paragraph attached to grand parent list item` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) It("attach to parent item", func() { @@ -1555,7 +1555,7 @@ paragraph attached to parent list item` }, }, } - verifyPreflight(expected, source) + verifyPreflight("test.adoc", expected, source) }) }) }) diff --git a/pkg/renderer/html5/blank_line_test.go b/pkg/renderer/html5/blank_line_test.go index f81ec574..0736ea0e 100644 --- a/pkg/renderer/html5/blank_line_test.go +++ b/pkg/renderer/html5/blank_line_test.go @@ -5,7 +5,7 @@ import . "github.com/onsi/ginkgo" var _ = Describe("blank lines", func() { It("blank line between 2 paragraphs", func() { - source := `first paragraph + source := `first paragraph second paragraph` expected := `
@@ -14,7 +14,7 @@ second paragraph`

second paragraph

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("blank line with spaces and tabs between 2 paragraphs", func() { @@ -27,7 +27,7 @@ second paragraph`

second paragraph

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("blank lines (tabs) at end of document", func() { @@ -38,7 +38,7 @@ second paragraph` expected := `

first paragraph

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("blank lines (spaces) at end of document", func() { @@ -49,6 +49,6 @@ second paragraph` expected := `

first paragraph

` - verify(expected, source) + verify("test.adoc", expected, source) }) }) diff --git a/pkg/renderer/html5/comment_test.go b/pkg/renderer/html5/comment_test.go index 24614ff8..9422d683 100644 --- a/pkg/renderer/html5/comment_test.go +++ b/pkg/renderer/html5/comment_test.go @@ -11,7 +11,7 @@ var _ = Describe("comments", func() { It("single line comment alone", func() { doc := `// A single-line comment.` expected := "" - verify(expected, doc) + verify("test.adoc", expected, doc) }) It("single line comment at end of line", func() { @@ -19,7 +19,7 @@ var _ = Describe("comments", func() { expected := `

foo // A single-line comment.

` - verify(expected, doc) + verify("test.adoc", expected, doc) }) It("single line comment within a paragraph", func() { @@ -30,7 +30,7 @@ another line`

a first line another line

` - verify(expected, doc) + verify("test.adoc", expected, doc) }) }) @@ -42,7 +42,7 @@ a *comment* block with multiple lines ////` expected := "" - verify(expected, doc) + verify("test.adoc", expected, doc) }) It("comment block with paragraphs around", func() { @@ -58,7 +58,7 @@ a second paragraph`

a second paragraph

` - verify(expected, doc) + verify("test.adoc", expected, doc) }) }) diff --git a/pkg/renderer/html5/cross_reference_test.go b/pkg/renderer/html5/cross_reference_test.go index 81d0d7d1..41fc8a2b 100644 --- a/pkg/renderer/html5/cross_reference_test.go +++ b/pkg/renderer/html5/cross_reference_test.go @@ -20,7 +20,7 @@ with some content linked to <>!` ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("cross-reference with custom id and label", func() { @@ -36,7 +36,7 @@ with some content linked to <>!` ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("invalid section reference", func() { @@ -53,7 +53,7 @@ with some content linked to <>!` ` - verify(expected, source) + verify("test.adoc", expected, source) }) }) }) diff --git a/pkg/renderer/html5/delimited_block_test.go b/pkg/renderer/html5/delimited_block_test.go index 44e18801..d8ec7db0 100644 --- a/pkg/renderer/html5/delimited_block_test.go +++ b/pkg/renderer/html5/delimited_block_test.go @@ -17,7 +17,7 @@ var _ = Describe("delimited blocks", func() { here ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("fenced block with id and title", func() { @@ -30,7 +30,7 @@ here here ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("fenced block with external link inside", func() { @@ -46,7 +46,7 @@ and more text on the next lines ` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -65,7 +65,7 @@ here here ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("listing block with ID and title", func() { @@ -80,7 +80,7 @@ some source code
some source code
` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -105,7 +105,7 @@ get '/hi' do end ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("with title, source and languages attributes", func() { @@ -128,7 +128,7 @@ get '/hi' do end ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("with id, title, source and languages attributes", func() { @@ -152,7 +152,7 @@ get '/hi' do end ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("with html content", func() { @@ -164,7 +164,7 @@ end
<a>link</a>
` - verify(expected, source) + verify("test.adoc", expected, source) }) It("with other content", func() { @@ -176,7 +176,7 @@ end
  a<<b
` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -204,7 +204,7 @@ with bold content

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("example block with multiple elements - case 2", func() { @@ -223,7 +223,7 @@ and more content ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("example block with multiple elements - case 3", func() { @@ -242,7 +242,7 @@ and "more" content ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("example block with ID and title", func() { @@ -259,7 +259,7 @@ foo ` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -295,7 +295,7 @@ with bold content

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("admonition block with ID and title", func() { @@ -331,7 +331,7 @@ with bold content

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("admonition block with ID, title and icon", func() { source := `:icons: font @@ -368,7 +368,7 @@ with bold content

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("admonition paragraph and admonition block with multiple elements", func() { @@ -413,7 +413,7 @@ this is an admonition paragraph. ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("admonition paragraph with an icon", func() { @@ -434,7 +434,7 @@ an admonition text on ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("admonition paragraph with ID, title and icon", func() { @@ -456,7 +456,7 @@ an admonition text on 1 line. ` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -478,7 +478,7 @@ ____` quote title ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("single-line quote with author and title, and ID and title ", func() { @@ -500,7 +500,7 @@ ____` quote title ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("multi-line quote with author and title", func() { @@ -531,7 +531,7 @@ ____` quote title ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("multi-line quote with author only and nested listing", func() { @@ -569,7 +569,7 @@ ____` — john doe ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("single-line quote with title only", func() { @@ -587,7 +587,7 @@ ____` — quote title ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("multi-line quote without author and title", func() { @@ -607,7 +607,7 @@ are preserved, but not trailing spaces

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("empty quote without author and title", func() { @@ -620,7 +620,7 @@ ____` ` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -639,7 +639,7 @@ ____` verse title ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("single-line verse with author, id and title ", func() { @@ -657,7 +657,7 @@ ____` verse title ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("multi-line verse with author and title", func() { @@ -680,7 +680,7 @@ and more! verse title ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("single-line verse with author only", func() { @@ -694,7 +694,7 @@ ____` — john doe ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("single-line verse with title only", func() { @@ -708,7 +708,7 @@ ____` — verse title ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("multi-line verse without author and title", func() { @@ -724,7 +724,7 @@ ____` and tabs are preserved ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("empty verse without author and title", func() { @@ -734,7 +734,7 @@ ____` expected := `

 
` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -752,7 +752,7 @@ some *verse* content ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("sidebar block with id, title, paragraph and sourcecode block", func() { @@ -779,7 +779,7 @@ bar ` - verify(expected, source) + verify("test.adoc", expected, source) }) }) }) diff --git a/pkg/renderer/html5/distinct_lists_test.go b/pkg/renderer/html5/distinct_lists_test.go index 15d25114..8faa370f 100644 --- a/pkg/renderer/html5/distinct_lists_test.go +++ b/pkg/renderer/html5/distinct_lists_test.go @@ -30,7 +30,7 @@ var _ = Describe("lists of items", func() { ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("same list with attribute on middle item", func() { @@ -56,7 +56,7 @@ var _ = Describe("lists of items", func() { ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("distinct lists separated by blankline and item attribute - case 1", func() { @@ -87,7 +87,7 @@ var _ = Describe("lists of items", func() { ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("distinct lists separated by blankline and item attribute - case 2", func() { @@ -121,7 +121,7 @@ var _ = Describe("lists of items", func() { ` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -139,7 +139,7 @@ var _ = Describe("lists of items", func() { ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("same list with multiple comment lines inside", func() { @@ -158,7 +158,7 @@ var _ = Describe("lists of items", func() { ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("distinct lists separated by single comment line", func() { @@ -180,7 +180,7 @@ var _ = Describe("lists of items", func() { ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("distinct lists separated by multiple comment lines", func() { @@ -204,6 +204,6 @@ var _ = Describe("lists of items", func() { ` - verify(expected, source) + verify("test.adoc", expected, source) }) }) diff --git a/pkg/renderer/html5/document_attribute_substitution_test.go b/pkg/renderer/html5/document_attribute_substitution_test.go index af56e0ce..068724a3 100644 --- a/pkg/renderer/html5/document_attribute_substitution_test.go +++ b/pkg/renderer/html5/document_attribute_substitution_test.go @@ -19,7 +19,7 @@ a paragraph` expected := `

a paragraph

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("a paragraph then some attributes", func() { @@ -31,7 +31,7 @@ a paragraph` expected := `

a paragraph

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("a paragraph with substitution", func() { @@ -41,7 +41,7 @@ a paragraph written by {author}` expected := `

a paragraph written by Xavier

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("paragraphs with definitions, substitutions and resets", func() { @@ -67,7 +67,7 @@ author is now {author}.`

author is now {author}.

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("front-matter then paragraph with substitutions", func() { @@ -79,7 +79,7 @@ author is {author}.` expected := `

author is Xavier.

` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -91,7 +91,7 @@ author is {author}.` expected := `

foo

` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -103,7 +103,7 @@ author is {author}.` expected := fmt.Sprintf(`

the %s symbol

`, rendered) - verify(expected, source) + verify("test.adoc", expected, source) }, Entry("sp symbol", "sp", " "), Entry("blank symbol", "blank", ""), @@ -143,7 +143,7 @@ a {blank} here.` expected := `

a foo here.

` - verify(expected, source) + verify("test.adoc", expected, source) }) }) diff --git a/pkg/renderer/html5/document_details_test.go b/pkg/renderer/html5/document_details_test.go index ea415d41..4e46e964 100644 --- a/pkg/renderer/html5/document_details_test.go +++ b/pkg/renderer/html5/document_details_test.go @@ -48,7 +48,7 @@ Last updated {{.LastUpdated}} ` - verify(expected, source, renderer.IncludeHeaderFooter(true), renderer.LastUpdated(time.Now())) + verify("test.adoc", expected, source, renderer.IncludeHeaderFooter(true), renderer.LastUpdated(time.Now())) }) It("header with 2 authors and no revision", func() { @@ -85,7 +85,7 @@ Last updated {{.LastUpdated}} ` - verify(expected, source, renderer.IncludeHeaderFooter(true), renderer.LastUpdated(time.Now())) + verify("test.adoc", expected, source, renderer.IncludeHeaderFooter(true), renderer.LastUpdated(time.Now())) }) }) diff --git a/pkg/renderer/html5/document_test.go b/pkg/renderer/html5/document_test.go index d67107eb..a90b8aa4 100644 --- a/pkg/renderer/html5/document_test.go +++ b/pkg/renderer/html5/document_test.go @@ -36,7 +36,7 @@ Last updated {{.LastUpdated}} ` - verify(expected, source, renderer.IncludeHeaderFooter(true), renderer.LastUpdated(time.Now())) + verify("test.adoc", expected, source, renderer.IncludeHeaderFooter(true), renderer.LastUpdated(time.Now())) }) }) diff --git a/pkg/renderer/html5/file_inclusion_test.go b/pkg/renderer/html5/file_inclusion_test.go index fbae40bc..a132fe86 100644 --- a/pkg/renderer/html5/file_inclusion_test.go +++ b/pkg/renderer/html5/file_inclusion_test.go @@ -27,7 +27,7 @@ include::../../../test/includes/chapter-a.adoc[leveloffset=+1]` ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("include non adoc file", func() { @@ -50,7 +50,7 @@ include::../../../test/includes/hello_world.go.txt[]` fmt.Println("hello, world!") }

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("include 2 files", func() { @@ -81,7 +81,7 @@ include::../../../test/includes/hello_world.go.txt[]` fmt.Println("hello, world!") }

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("include file and append following elements in included section", func() { @@ -109,7 +109,7 @@ a third paragraph` ` - verify(expected, source) + verify("test.adoc", expected, source) }) Context("file inclusion in delimited blocks", func() { @@ -134,7 +134,7 @@ include::../../../test/includes/chapter-a.adoc[] content ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("should include adoc file within fenced block", func() { @@ -148,7 +148,7 @@ content content ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("should include adoc file within example block", func() { @@ -165,7 +165,7 @@ include::../../../test/includes/chapter-a.adoc[] ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("should include adoc file within quote block", func() { @@ -182,7 +182,7 @@ ____` ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("should include adoc file within verse block", func() { @@ -195,7 +195,7 @@ ____` content ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("should include adoc file within sidebar block", func() { @@ -212,7 +212,7 @@ include::../../../test/includes/chapter-a.adoc[] ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("should include adoc file within passthrough block", func() { @@ -221,7 +221,7 @@ include::../../../test/includes/chapter-a.adoc[] include::../../../test/includes/chapter-a.adoc[] ++++` expected := `` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -249,7 +249,7 @@ func helloworld() { } ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("should include go file within fenced block", func() { @@ -267,7 +267,7 @@ func helloworld() { } ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("should include go file within example block", func() { @@ -289,7 +289,7 @@ include::../../../test/includes/hello_world.go.txt[] ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("should include go file within quote block", func() { @@ -311,7 +311,7 @@ ____` ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("should include go file within verse block", func() { @@ -328,7 +328,7 @@ func helloworld() { fmt.Println("hello, world!") } ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("should include go file within sidebar block", func() { @@ -350,7 +350,7 @@ include::../../../test/includes/hello_world.go.txt[] ` - verify(expected, source) + verify("test.adoc", expected, source) }) }) }) @@ -364,7 +364,7 @@ include::../../../test/includes/hello_world.go.txt[] expected := `

package includes

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("should include multiple lines as paragraph", func() { @@ -374,7 +374,7 @@ include::../../../test/includes/hello_world.go.txt[] fmt.Println("hello, world!") }

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("should include multiple ranges as paragraph", func() { @@ -387,7 +387,7 @@ include::../../../test/includes/hello_world.go.txt[] fmt.Println("hello, world!") }

` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -402,7 +402,7 @@ include::../../../test/includes/hello_world.go.txt[lines=1]
package includes
` - verify(expected, source) + verify("test.adoc", expected, source) }) It("should include multiple lines in listing block", func() { @@ -416,7 +416,7 @@ include::../../../test/includes/hello_world.go.txt[lines=5..7] } ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("should include multiple ranges in listing block", func() { @@ -432,7 +432,7 @@ func helloworld() { } ` - verify(expected, source) + verify("test.adoc", expected, source) }) }) }) @@ -446,7 +446,7 @@ func helloworld() {
` - verify(expected, source) + verify("test.adoc", expected, source) }) It("file inclusion with surrounding tag", func() { @@ -459,7 +459,7 @@ func helloworld() { ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("file inclusion with unclosed tag", func() { @@ -470,14 +470,14 @@ func helloworld() {

end

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("file inclusion with unknown tag", func() { source := `include::../../../test/includes/tag-include.adoc[tag=unknown]` expected := `` // TODO: verify error in logs - verify(expected, source) + verify("test.adoc", expected, source) }) It("file inclusion with no tag", func() { @@ -493,7 +493,7 @@ func helloworld() { ` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -519,7 +519,7 @@ func helloworld() {

last line of parent

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("should include child and grandchild content in listing block", func() { @@ -541,7 +541,7 @@ last line of child last line of parent ` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -557,7 +557,7 @@ include::{includedir}/grandchild-include.adoc[]`

last line of grandchild

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("should resolve path with attribute in delimited block", func() { @@ -573,7 +573,7 @@ include::{includedir}/grandchild-include.adoc[] last line of grandchild ` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -587,7 +587,7 @@ last line of grandchild expected := `

Unresolved directive in test.adoc - include::../../../test/includes/unknown.adoc[leveloffset=+1]

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("should replace with string element if file with attribute in path is not resolved", func() { @@ -596,7 +596,7 @@ last line of grandchild expected := `

Unresolved directive in test.adoc - include::{includedir}/unknown.adoc[leveloffset=+1]

` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -611,7 +611,7 @@ include::../../../test/includes/unknown.adoc[leveloffset=+1]
Unresolved directive in test.adoc - include::../../../test/includes/unknown.adoc[leveloffset=+1]
` - verify(expected, source) + verify("test.adoc", expected, source) }) It("should replace with string element if file with attribute in path is not resolved", func() { @@ -623,7 +623,7 @@ include::{includedir}/unknown.adoc[leveloffset=+1]
Unresolved directive in test.adoc - include::{includedir}/unknown.adoc[leveloffset=+1]
` - verify(expected, source) + verify("test.adoc", expected, source) }) }) }) diff --git a/pkg/renderer/html5/footnote_test.go b/pkg/renderer/html5/footnote_test.go index 12e0b52a..5c32f6ff 100644 --- a/pkg/renderer/html5/footnote_test.go +++ b/pkg/renderer/html5/footnote_test.go @@ -22,7 +22,7 @@ var _ = Describe("footnotes", func() { 1. a note for foo ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("rich footnote in a paragraph", func() { @@ -36,7 +36,7 @@ var _ = Describe("footnotes", func() { 1. some rich content ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("footnoteref with valid ref in a paragraph", func() { @@ -50,7 +50,7 @@ var _ = Describe("footnotes", func() { 1. a note for foo ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("footnoteref with invalid ref in a paragraph", func() { @@ -64,7 +64,7 @@ var _ = Describe("footnotes", func() { 1. a note for foo ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("footnotes everywhere", func() { @@ -105,6 +105,6 @@ a paragraph with another footnote:[baz]` 3. baz ` - verify(expected, source) + verify("test.adoc", expected, source) }) }) diff --git a/pkg/renderer/html5/html5_test.go b/pkg/renderer/html5/html5_test.go index 392300cb..6c360897 100644 --- a/pkg/renderer/html5/html5_test.go +++ b/pkg/renderer/html5/html5_test.go @@ -15,9 +15,9 @@ import ( "github.com/stretchr/testify/require" ) -func verify(expected, content string, rendererOpts ...renderer.Option) { +func verify(filename, expected, content string, rendererOpts ...renderer.Option) { reader := strings.NewReader(content) - doc, err := parser.ParseDocument("", reader) + doc, err := parser.ParseDocument(filename, reader) require.NoError(GinkgoT(), err, "Error found while parsing the document") GinkgoT().Logf("actual document: `%s`", spew.Sdump(doc)) buff := bytes.NewBuffer(nil) diff --git a/pkg/renderer/html5/image_test.go b/pkg/renderer/html5/image_test.go index f1f7166a..2cec3d3b 100644 --- a/pkg/renderer/html5/image_test.go +++ b/pkg/renderer/html5/image_test.go @@ -14,7 +14,7 @@ var _ = Describe("images", func() { foo ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("block image with alt", func() { @@ -25,7 +25,7 @@ var _ = Describe("images", func() { foo image ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("block image with alt and dimensions", func() { @@ -36,7 +36,7 @@ var _ = Describe("images", func() { foo image ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("block image with title, alt and dimensions", func() { @@ -50,7 +50,7 @@ image::images/foo.png[the foo.png image,600,400]`
Figure 1. A title to foobar
` - verify(expected, source) + verify("test.adoc", expected, source) }) It("block image with role above", func() { @@ -64,7 +64,7 @@ image::foo.png[foo image, 600, 400]`
Figure 1. mytitle
` - verify(expected, source) + verify("test.adoc", expected, source) }) It("block image with id, title and role inline", func() { @@ -75,7 +75,7 @@ image::foo.png[foo image, 600, 400]`
Figure 1. mytitle
` - verify(expected, source) + verify("test.adoc", expected, source) }) It("2 block images", func() { @@ -91,7 +91,7 @@ image::appa.png[]` appa ` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -105,7 +105,7 @@ image::appa.png[]` expected := `

app

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("inline image with id, title and role", func() { @@ -113,7 +113,7 @@ image::appa.png[]` expected := `

foo

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("inline image with alt", func() { @@ -121,7 +121,7 @@ image::appa.png[]` expected := `

foo image

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("inline image with alt and dimensions", func() { @@ -129,7 +129,7 @@ image::appa.png[]` expected := `

foo image

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("paragraph with inline image with alt and dimensions", func() { @@ -137,7 +137,7 @@ image::appa.png[]` expected := `

a foo foo image bar

` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -148,7 +148,7 @@ image::appa.png[]` expected := `

a foo image::foo.png[foo image, 600, 400] bar

` - verify(expected, source) + verify("test.adoc", expected, source) }) }) }) @@ -164,7 +164,7 @@ image::foo.png[]` foo ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("2 block images with relative locations and imagedir changed in-between", func() { @@ -184,7 +184,7 @@ image::bar.png[]` bar ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("block image with absolute URL", func() { @@ -196,7 +196,7 @@ image::https://example.com/foo.png[]` foo ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("block image with absolute filepath", func() { @@ -208,7 +208,7 @@ image::/bar/foo.png[]` foo ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("block image with absolute file scheme and path", func() { @@ -220,7 +220,7 @@ image::file:///bar/foo.png[]` foo ` - verify(expected, source) + verify("test.adoc", expected, source) }) }) }) diff --git a/pkg/renderer/html5/labeled_list_test.go b/pkg/renderer/html5/labeled_list_test.go index b631cd7d..dac94bf5 100644 --- a/pkg/renderer/html5/labeled_list_test.go +++ b/pkg/renderer/html5/labeled_list_test.go @@ -36,7 +36,7 @@ on 2 lines, too.

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("labeled list with an empty entry", func() { @@ -51,7 +51,7 @@ item 2:: description 2.` ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("labeled list with an image", func() { @@ -69,7 +69,7 @@ item 2:: description 2.` ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("labeled list with script injection", func() { @@ -82,7 +82,7 @@ item 2:: description 2.` ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("labeled list with fenced block", func() { @@ -109,7 +109,7 @@ item 2:: description 2.` ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("labeled list with nested lists using regular layout", func() { @@ -146,7 +146,7 @@ item 2:: something simple` ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("labeled list with title", func() { @@ -166,7 +166,7 @@ second term:: definition of the second term` ` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -206,7 +206,7 @@ on 2 lines, too.

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("labeled list with nested lists using horizontal layout", func() { @@ -252,7 +252,7 @@ item 2 ` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -280,7 +280,7 @@ item 2:: description 2.` ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("labeled list with blockcontinuation", func() { @@ -294,7 +294,7 @@ Item 2:: something simple ---- another delimited block ----` - expectedDocument := `
+ expected := `
Item 1
@@ -316,7 +316,7 @@ another delimited block
` - verify(expectedDocument, source) + verify("test.adoc", expected, source) }) It("labeled list without continuation", func() { @@ -328,7 +328,7 @@ Item 2:: something simple ---- another delimited block ----` - expectedDocument := `
+ expected := `
Item 1
@@ -352,7 +352,7 @@ another delimited block
` - verify(expectedDocument, source) + verify("test.adoc", expected, source) }) }) @@ -365,7 +365,7 @@ Item 2::: Item 2 description Item 3:::: Item 3 description` - expectedDocument := `
+ expected := `
Item 1
@@ -389,7 +389,7 @@ Item 3 description`
` - verify(expectedDocument, source) + verify("test.adoc", expected, source) }) }) @@ -402,7 +402,7 @@ What is libsciidoc?:: An implementation of the AsciiDoc processor in Golang. What is the answer to the Ultimate Question?:: 42` - expectedDocument := `
+ expected := `
Q&A
  1. @@ -415,7 +415,7 @@ What is the answer to the Ultimate Question?:: 42`
` - verify(expectedDocument, source) + verify("test.adoc", expected, source) }) }) @@ -459,7 +459,7 @@ paragraph attached to grandparent list item`
` - verify(expected, source) + verify("test.adoc", expected, source) }) It("attach to parent labeled list item", func() { @@ -499,7 +499,7 @@ paragraph attached to parent list item`
` - verify(expected, source) + verify("test.adoc", expected, source) }) It("attach to child labeled list item", func() { @@ -538,7 +538,7 @@ paragraph attached to child list item`
` - verify(expected, source) + verify("test.adoc", expected, source) }) }) }) diff --git a/pkg/renderer/html5/link_test.go b/pkg/renderer/html5/link_test.go index 09ae9dab..f1b271c1 100644 --- a/pkg/renderer/html5/link_test.go +++ b/pkg/renderer/html5/link_test.go @@ -14,7 +14,7 @@ var _ = Describe("links", func() { expected := `

a link to https://foo.com.

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("external link with quoted text", func() { @@ -22,7 +22,7 @@ var _ = Describe("links", func() { expected := `` - verify(expected, source) + verify("test.adoc", expected, source) }) It("external link with text having comma", func() { @@ -30,7 +30,7 @@ var _ = Describe("links", func() { expected := `` - verify(expected, source) + verify("test.adoc", expected, source) }) It("external link inside a multiline paragraph", func() { @@ -43,7 +43,7 @@ next lines` and more text on the next lines

` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -54,7 +54,7 @@ next lines

expected := `

a link to foo.adoc.

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("relative link to doc with text", func() { @@ -62,7 +62,7 @@ next lines

expected := `

a link to foo doc.

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("relative link with text having comma", func() { @@ -70,7 +70,7 @@ next lines

expected := `

a link to A, B, and C

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("relative link to external URL with text", func() { @@ -78,7 +78,7 @@ next lines

expected := `

a link to foo doc.

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("invalid relative link to doc", func() { @@ -86,7 +86,7 @@ next lines

expected := `

a link to link:foo.adoc.

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("relative link with quoted text", func() { @@ -94,7 +94,7 @@ next lines

expected := `` - verify(expected, source) + verify("test.adoc", expected, source) }) }) diff --git a/pkg/renderer/html5/literal_block_test.go b/pkg/renderer/html5/literal_block_test.go index 4f38e078..fb422f19 100644 --- a/pkg/renderer/html5/literal_block_test.go +++ b/pkg/renderer/html5/literal_block_test.go @@ -15,7 +15,7 @@ var _ = Describe("literal blocks", func() {
some literal content
` - verify(expected, source) + verify("test.adoc", expected, source) }) It("literal block from paragraph with single space on first line", func() { @@ -29,7 +29,7 @@ on 3 lines. ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("literal block from paragraph with same spaces on each line", func() { @@ -43,7 +43,7 @@ on 3 lines. ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("literal block from paragraph with single spaces on each line", func() { @@ -57,7 +57,7 @@ lines. has some heading spaces preserved. ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("mixing literal block with attributes followed by a paragraph ", func() { @@ -75,7 +75,7 @@ a normal paragraph.`

a normal paragraph.

` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -97,7 +97,7 @@ a normal paragraph.`

a normal paragraph.

` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -121,7 +121,7 @@ a normal paragraph.`

a normal paragraph.

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("literal block from 2-lines paragraph with attribute", func() { @@ -142,7 +142,7 @@ on two lines.

a normal paragraph.

` - verify(expected, source) + verify("test.adoc", expected, source) }) }) diff --git a/pkg/renderer/html5/ordered_list_test.go b/pkg/renderer/html5/ordered_list_test.go index e7a890de..f975a2fc 100644 --- a/pkg/renderer/html5/ordered_list_test.go +++ b/pkg/renderer/html5/ordered_list_test.go @@ -17,7 +17,7 @@ var _ = Describe("ordered lists", func() { ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("ordered list item with explicit start only", func() { @@ -30,7 +30,7 @@ var _ = Describe("ordered lists", func() { ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("ordered list item with explicit quoted numbering and start", func() { @@ -43,7 +43,7 @@ var _ = Describe("ordered lists", func() { ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("ordered list with paragraph continuation", func() { @@ -60,7 +60,7 @@ foo` ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("ordered list with delimited block continuation", func() { @@ -81,7 +81,7 @@ foo ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("ordered list with unnumbered items", func() { @@ -129,7 +129,7 @@ foo ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("ordered list mixed with unordered list - simple case", func() { @@ -173,7 +173,7 @@ foo ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("ordered list mixed with unordered list - complex case", func() { @@ -298,7 +298,7 @@ extra lines.

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("all kinds of lists - complex case 3", func() { @@ -342,7 +342,7 @@ a. foo ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("drop principal text in list item", func() { @@ -376,7 +376,7 @@ print("one") ` - verify(expected, source) + verify("test.adoc", expected, source) }) Context("attach to ordered list item ancestor", func() { @@ -413,7 +413,7 @@ paragraph attached to grandparent list item` ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("attach to parent ordered list item", func() { @@ -447,7 +447,7 @@ paragraph attached to parent list item` ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("attach to child ordered list item", func() { @@ -480,7 +480,7 @@ paragraph attached to child list item` ` - verify(expected, source) + verify("test.adoc", expected, source) }) }) }) diff --git a/pkg/renderer/html5/paragraph_test.go b/pkg/renderer/html5/paragraph_test.go index 1c59fa55..7295d920 100644 --- a/pkg/renderer/html5/paragraph_test.go +++ b/pkg/renderer/html5/paragraph_test.go @@ -15,7 +15,7 @@ var _ = Describe("paragraphs", func() {

bold content & more content afterwards

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("a standalone paragraph with trailing spaces", func() { @@ -25,7 +25,7 @@ var _ = Describe("paragraphs", func() {

bold content & more content afterwards…​

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("a standalone paragraph with an ID and a title", func() { @@ -36,7 +36,7 @@ var _ = Describe("paragraphs", func() {
a title

bold content with more content afterwards…​

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("2 paragraphs and blank line", func() { @@ -52,7 +52,7 @@ and here another paragraph

and here another paragraph

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("paragraph with single quotes", func() { @@ -60,7 +60,7 @@ and here another paragraph expected := `

a 'subsection' paragraph.

` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -75,7 +75,7 @@ baz` bar baz

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("with paragraph attribute", func() { @@ -89,7 +89,7 @@ baz` bar
baz

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("with document attribute", func() { @@ -102,7 +102,7 @@ baz` bar
baz

` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -122,7 +122,7 @@ this is a note. ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("multiline warning admonition paragraph", func() { @@ -141,7 +141,7 @@ warning! ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("admonition note paragraph with id and title", func() { @@ -161,7 +161,7 @@ this is a note. ` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -182,7 +182,7 @@ this is a caution! ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("multiline caution admonition paragraph with title and id", func() { @@ -205,7 +205,7 @@ this is a ` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -221,7 +221,7 @@ I am a verse paragraph.` verse title ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("paragraph as a verse with author, title and other attributes", func() { @@ -237,7 +237,7 @@ I am a verse paragraph.` verse title ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("paragraph as a verse with empty title", func() { @@ -249,7 +249,7 @@ I am a verse paragraph.` — john doe ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("paragraph as a verse without title", func() { @@ -261,7 +261,7 @@ I am a verse paragraph.` — john doe ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("paragraph as a verse with empty author", func() { @@ -270,7 +270,7 @@ I am a verse paragraph.` expected := `
I am a verse paragraph.
` - verify(expected, source) + verify("test.adoc", expected, source) }) It("paragraph as a verse without author", func() { @@ -279,7 +279,7 @@ I am a verse paragraph.` expected := `
I am a verse paragraph.
` - verify(expected, source) + verify("test.adoc", expected, source) }) It("image block as a verse", func() { @@ -292,7 +292,7 @@ image::foo.png[]` verse title ` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -310,7 +310,7 @@ some quote content quote title ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("paragraph as a quote with author, title and other attributes", func() { @@ -328,7 +328,7 @@ I am a quote paragraph. quote title ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("paragraph as a quote with empty title", func() { @@ -342,7 +342,7 @@ I am a quote paragraph. — john doe ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("paragraph as a quote without title", func() { @@ -356,7 +356,7 @@ I am a quote paragraph. — john doe ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("paragraph as a quote with empty author", func() { @@ -367,7 +367,7 @@ I am a quote paragraph.` I am a quote paragraph. ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("paragraph as a quote without author", func() { @@ -378,7 +378,7 @@ I am a quote paragraph.` I am a quote paragraph. ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("inline image within a quote", func() { @@ -393,7 +393,7 @@ a foo foo quote title ` - verify(expected, source) + verify("test.adoc", expected, source) }) It("image block is NOT a quote", func() { @@ -404,7 +404,7 @@ image::foo.png[]` foo ` - verify(expected, source) + verify("test.adoc", expected, source) }) }) diff --git a/pkg/renderer/html5/passthrough_test.go b/pkg/renderer/html5/passthrough_test.go index 5abead1b..452fb95f 100644 --- a/pkg/renderer/html5/passthrough_test.go +++ b/pkg/renderer/html5/passthrough_test.go @@ -9,7 +9,7 @@ var _ = Describe("passthroughs", func() { It("an empty standalone tripleplus passthrough", func() { source := `++++++` expected := `` - verify(expected, source) + verify("test.adoc", expected, source) }) It("an empty tripleplus passthrough in a paragraph", func() { @@ -17,7 +17,7 @@ var _ = Describe("passthroughs", func() { expected := `

with more content afterwards…​

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("a standalone tripleplus passthrough", func() { @@ -25,7 +25,7 @@ var _ = Describe("passthroughs", func() { expected := `

*bold content*

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("tripleplus passthrough in paragraph", func() { @@ -33,7 +33,7 @@ var _ = Describe("passthroughs", func() { expected := `

The text underline & me is underlined.

` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -44,7 +44,7 @@ var _ = Describe("passthroughs", func() { expected := `

++

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("an empty singleplus passthrough in a paragraph", func() { @@ -52,7 +52,7 @@ var _ = Describe("passthroughs", func() { expected := `

++ with more content afterwards…​

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("a singleplus passthrough", func() { @@ -60,7 +60,7 @@ var _ = Describe("passthroughs", func() { expected := `

*bold content*

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("singleplus passthrough in paragraph", func() { @@ -68,7 +68,7 @@ var _ = Describe("passthroughs", func() { expected := `

The text <u>underline me</u> is not underlined.

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("invalid singleplus passthrough in paragraph", func() { @@ -76,7 +76,7 @@ var _ = Describe("passthroughs", func() { expected := `

The text + hello, world + is not passed through.

` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -87,7 +87,7 @@ var _ = Describe("passthroughs", func() { expected := `

hello

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("passthrough macro with words", func() { @@ -95,13 +95,13 @@ var _ = Describe("passthroughs", func() { expected := `

hello, world

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("empty passthrough macro", func() { source := `pass:[]` expected := `` - verify(expected, source) + verify("test.adoc", expected, source) }) It("passthrough macro with spaces", func() { @@ -109,7 +109,7 @@ var _ = Describe("passthroughs", func() { expected := `

*hello*, world

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("passthrough macro with line break", func() { @@ -118,7 +118,7 @@ var _ = Describe("passthroughs", func() {

hello, world

` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -129,7 +129,7 @@ world

expected := `

hello

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("passthrough macro with quoted word in sentence and trailing spaces", func() { @@ -137,7 +137,7 @@ world

expected := `

a hello, world

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("passthrough macro within paragraph", func() { @@ -145,7 +145,7 @@ world

expected := `

an hello, world mention

` - verify(expected, source) + verify("test.adoc", expected, source) }) }) }) diff --git a/pkg/renderer/html5/quoted_text_test.go b/pkg/renderer/html5/quoted_text_test.go index aaa002c2..89d6f62a 100644 --- a/pkg/renderer/html5/quoted_text_test.go +++ b/pkg/renderer/html5/quoted_text_test.go @@ -13,7 +13,7 @@ var _ = Describe("quoted texts", func() { expected := `

bold content

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("bold content in sentence", func() { @@ -21,7 +21,7 @@ var _ = Describe("quoted texts", func() { expected := `

some bold content.

` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -32,7 +32,7 @@ var _ = Describe("quoted texts", func() { expected := `

italic content

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("italic content in sentence", func() { @@ -41,7 +41,7 @@ var _ = Describe("quoted texts", func() { expected := `

some italic content.

` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -52,7 +52,7 @@ var _ = Describe("quoted texts", func() { expected := `

monospace content

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("monospace content in sentence", func() { @@ -61,7 +61,7 @@ var _ = Describe("quoted texts", func() { expected := `

some monospace content.

` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -72,7 +72,7 @@ var _ = Describe("quoted texts", func() { expected := `

subscriptcontent

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("subscript content in sentence", func() { @@ -81,7 +81,7 @@ var _ = Describe("quoted texts", func() { expected := `

some subscriptcontent.

` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -92,7 +92,7 @@ var _ = Describe("quoted texts", func() { expected := `

superscriptcontent

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("superscript content in sentence", func() { @@ -101,7 +101,7 @@ var _ = Describe("quoted texts", func() { expected := `

some superscriptcontent.

` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -113,7 +113,7 @@ var _ = Describe("quoted texts", func() { expected := `

some *nested bold content*.

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("italic content within bold quote in sentence", func() { @@ -121,7 +121,7 @@ var _ = Describe("quoted texts", func() { expected := `

some bold and italic content together.

` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -132,7 +132,7 @@ var _ = Describe("quoted texts", func() { expected := `

some *bold and italic content * together.

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("invalid italic content within bold quote in sentence", func() { @@ -141,7 +141,7 @@ var _ = Describe("quoted texts", func() { expected := `

some bold and _italic content _ together.

` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -152,7 +152,7 @@ var _ = Describe("quoted texts", func() { expected := `

some *bold content*.

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("italic content within escaped bold quote in sentence", func() { @@ -160,7 +160,7 @@ var _ = Describe("quoted texts", func() { expected := `

some *bold and italic content* together.

` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -172,7 +172,7 @@ var _ = Describe("quoted texts", func() { expected := `

*a

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("unbalanced bold in monospace - case 2", func() { @@ -180,7 +180,7 @@ var _ = Describe("quoted texts", func() { expected := `

a*b

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("italic in monospace", func() { @@ -188,7 +188,7 @@ var _ = Describe("quoted texts", func() { expected := `

a

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("unbalanced italic in monospace", func() { @@ -196,7 +196,7 @@ var _ = Describe("quoted texts", func() { expected := `

a_b

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("unparsed bold in monospace", func() { @@ -204,7 +204,7 @@ var _ = Describe("quoted texts", func() { expected := `

a*b*

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("parsed subscript in monospace", func() { @@ -212,7 +212,7 @@ var _ = Describe("quoted texts", func() { expected := `

ab

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("multiline in monospace - case 1", func() { @@ -221,7 +221,7 @@ var _ = Describe("quoted texts", func() {

a b

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("multiline in monospace - case 2", func() { @@ -230,7 +230,7 @@ b

a b

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("link in bold", func() { @@ -238,7 +238,7 @@ b

expected := `

a b

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("image in bold", func() { @@ -246,7 +246,7 @@ b

expected := `

a foo

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("singleplus passthrough in bold", func() { @@ -254,7 +254,7 @@ b

expected := `

a image:foo.png[]

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("tripleplus passthrough in bold", func() { @@ -262,7 +262,7 @@ b

expected := `

a image:foo.png[]

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("link in italic", func() { @@ -270,7 +270,7 @@ b

expected := `

a b

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("image in italic", func() { @@ -278,7 +278,7 @@ b

expected := `

a foo

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("singleplus passthrough in italic", func() { @@ -286,7 +286,7 @@ b

expected := `

a image:foo.png[]

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("tripleplus passthrough in italic", func() { @@ -294,7 +294,7 @@ b

expected := `

a image:foo.png[]

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("link in monospace", func() { @@ -302,7 +302,7 @@ b

expected := `

a b

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("image in monospace", func() { @@ -310,7 +310,7 @@ b

expected := `

a foo

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("singleplus passthrough in monospace", func() { @@ -318,7 +318,7 @@ b

expected := `

a image:foo.png[]

` - verify(expected, source) + verify("test.adoc", expected, source) }) It("tripleplus passthrough in monospace", func() { @@ -326,7 +326,7 @@ b

expected := `

a image:foo.png[]

` - verify(expected, source) + verify("test.adoc", expected, source) }) }) diff --git a/pkg/renderer/html5/section_test.go b/pkg/renderer/html5/section_test.go index 826386a6..a6b9dc7d 100644 --- a/pkg/renderer/html5/section_test.go +++ b/pkg/renderer/html5/section_test.go @@ -11,7 +11,7 @@ var _ = Describe("sections", func() { // top-level section is not rendered per-say, // but the section will be used to set the HTML page's element expected := `` - verify(expected, source) + verify("test.adoc", expected, source) }) It("section level 1 alone", func() { @@ -23,7 +23,7 @@ var _ = Describe("sections", func() { <div class="sectionbody"> </div> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) It("section level 2 alone", func() { @@ -33,7 +33,7 @@ var _ = Describe("sections", func() { expected := `<div class="sect2"> <h3 id="_a_title">a title</h3> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) It("section level 1 with just bold content", func() { @@ -43,7 +43,7 @@ var _ = Describe("sections", func() { <div class="sectionbody"> </div> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) It("section level 2 with nested bold content", func() { @@ -51,7 +51,7 @@ var _ = Describe("sections", func() { expected := `<div class="sect2"> <h3 id="_a_section_title_with_bold_content">a section title, with <strong>bold content</strong></h3> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) It("section level 1 with custom ID", func() { @@ -65,7 +65,7 @@ var _ = Describe("sections", func() { <div class="sectionbody"> </div> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) It("section level 1 with custom prefix id", func() { @@ -78,7 +78,7 @@ var _ = Describe("sections", func() { <div class="sectionbody"> </div> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) It("sections with same title", func() { @@ -95,7 +95,7 @@ var _ = Describe("sections", func() { <div class="sectionbody"> </div> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -120,7 +120,7 @@ and a second paragraph` </div> </div> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) It("section with just a paragraph", func() { @@ -132,7 +132,7 @@ a paragraph` expected := `<div class="paragraph"> <p>a paragraph</p> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) It("header with preamble then section level 1", func() { @@ -165,7 +165,7 @@ with some text` </div> </div> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) It("header with preamble then 2 sections level 1", func() { @@ -210,7 +210,7 @@ with some text, too` </div> </div> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) It("section with listing block and subsection", func() { @@ -242,7 +242,7 @@ Listing block content is commonly used to preserve code input.</pre> </div> </div> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -273,7 +273,7 @@ here</p> </div> </div> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) It("should not include preamble wrapper", func() { @@ -296,7 +296,7 @@ here</p> </div> </div> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) }) }) diff --git a/pkg/renderer/html5/string_test.go b/pkg/renderer/html5/string_test.go index d91f9f5b..9439059b 100644 --- a/pkg/renderer/html5/string_test.go +++ b/pkg/renderer/html5/string_test.go @@ -15,7 +15,7 @@ var _ = Describe("strings", func() { expected := `<div class="paragraph"> <p>some text…​</p> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) }) }) diff --git a/pkg/renderer/html5/table_of_contents_test.go b/pkg/renderer/html5/table_of_contents_test.go index cb906cc1..12a8a588 100644 --- a/pkg/renderer/html5/table_of_contents_test.go +++ b/pkg/renderer/html5/table_of_contents_test.go @@ -79,7 +79,7 @@ A preamble... <div class="sectionbody"> </div> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) It("toc with custom level", func() { @@ -167,7 +167,7 @@ A preamble... <div class="sectionbody"> </div> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) It("document with no section", func() { @@ -179,7 +179,7 @@ level 1 sections not exists.` expected := `<div class="paragraph"> <p>level 1 sections not exists.</p> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) }) diff --git a/pkg/renderer/html5/table_test.go b/pkg/renderer/html5/table_test.go index 4c4f2f42..34b11d84 100644 --- a/pkg/renderer/html5/table_test.go +++ b/pkg/renderer/html5/table_test.go @@ -20,7 +20,7 @@ var _ = Describe("tables", func() { </tr> </tbody> </table>` - verify(expected, source) + verify("test.adoc", expected, source) }) It("1-line table with 3 cells", func() { @@ -41,7 +41,7 @@ var _ = Describe("tables", func() { </tr> </tbody> </table>` - verify(expected, source) + verify("test.adoc", expected, source) }) It("table with title, headers and 1 line per cell", func() { @@ -78,7 +78,7 @@ var _ = Describe("tables", func() { </tr> </tbody> </table>` - verify(expected, source) + verify("test.adoc", expected, source) }) It("empty table ", func() { @@ -86,7 +86,7 @@ var _ = Describe("tables", func() { |===` expected := `<table class="tableblock frame-all grid-all stretch"> </table>` - verify(expected, source) + verify("test.adoc", expected, source) }) It("2 tables with 1 counter", func() { @@ -123,7 +123,7 @@ var _ = Describe("tables", func() { </tr> </tbody> </table>` - verify(expected, source) + verify("test.adoc", expected, source) }) It("2 tables with 2 counters", func() { @@ -162,7 +162,7 @@ var _ = Describe("tables", func() { </tr> </tbody> </table>` - verify(expected, source) + verify("test.adoc", expected, source) }) }) diff --git a/pkg/renderer/html5/unordered_list_test.go b/pkg/renderer/html5/unordered_list_test.go index ac4cc9ba..96cf079b 100644 --- a/pkg/renderer/html5/unordered_list_test.go +++ b/pkg/renderer/html5/unordered_list_test.go @@ -21,7 +21,7 @@ var _ = Describe("unordered lists", func() { </li> </ul> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) It("simple unordered list with no title then a paragraph", func() { @@ -46,7 +46,7 @@ and a standalone paragraph` <div class="paragraph"> <p>and a standalone paragraph</p> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) It("simple unordered list with title and role", func() { @@ -66,7 +66,7 @@ and a standalone paragraph` </li> </ul> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) It("simple unordered list with continuation", func() { @@ -88,7 +88,7 @@ foo </li> </ul> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) It("nested unordered lists without a title", func() { @@ -116,7 +116,7 @@ foo </li> </ul> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) It("nested unordered lists with a title", func() { @@ -145,7 +145,7 @@ foo </li> </ul> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) It("unordered list with item continuation", func() { @@ -180,7 +180,7 @@ another delimited block </li> </ul> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) It("unordered list without item continuation", func() { @@ -216,7 +216,7 @@ another delimited block <pre>another delimited block</pre> </div> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) }) @@ -245,7 +245,7 @@ var _ = Describe("checklists", func() { </li> </ul> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) It("parent checklist with title and nested checklist", func() { @@ -279,7 +279,7 @@ var _ = Describe("checklists", func() { </li> </ul> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) It("parent checklist with role and nested normal list", func() { @@ -308,7 +308,7 @@ var _ = Describe("checklists", func() { </li> </ul> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) Context("attach to unordered list item ancestor", func() { @@ -345,7 +345,7 @@ paragraph attached to grandparent list item` </li> </ul> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) It("attach to parent unordered list item", func() { @@ -379,7 +379,7 @@ paragraph attached to parent list item` </li> </ul> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) It("attach to child unordered list item", func() { @@ -412,7 +412,7 @@ paragraph attached to child list item` </li> </ul> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) }) }) diff --git a/pkg/renderer/html5/user_macro_test.go b/pkg/renderer/html5/user_macro_test.go index 22e4ef90..8ed4e07d 100644 --- a/pkg/renderer/html5/user_macro_test.go +++ b/pkg/renderer/html5/user_macro_test.go @@ -20,7 +20,7 @@ var _ = Describe("user macros", func() { expected := `<div class="paragraph"> <p>hello::[]</p> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) It("user macro block", func() { @@ -31,7 +31,7 @@ var _ = Describe("user macros", func() { <span>hello world</span> </div> </div>` - verify(expected, source, renderer.DefineMacro(helloMacroTmpl.Name(), helloMacroTmpl)) + verify("test.adoc", expected, source, renderer.DefineMacro(helloMacroTmpl.Name(), helloMacroTmpl)) }) It("user macro block with attribute", func() { @@ -42,7 +42,7 @@ var _ = Describe("user macros", func() { <span>hello world!!!!</span> </div> </div>` - verify(expected, source, renderer.DefineMacro(helloMacroTmpl.Name(), helloMacroTmpl)) + verify("test.adoc", expected, source, renderer.DefineMacro(helloMacroTmpl.Name(), helloMacroTmpl)) }) It("user macro block with value", func() { @@ -53,7 +53,7 @@ var _ = Describe("user macros", func() { <span>hello John Doe</span> </div> </div>` - verify(expected, source, renderer.DefineMacro(helloMacroTmpl.Name(), helloMacroTmpl)) + verify("test.adoc", expected, source, renderer.DefineMacro(helloMacroTmpl.Name(), helloMacroTmpl)) }) It("user macro block with value and attributes", func() { @@ -64,7 +64,7 @@ var _ = Describe("user macros", func() { <span>Hi John Doe!!</span> </div> </div>` - verify(expected, source, renderer.DefineMacro(helloMacroTmpl.Name(), helloMacroTmpl)) + verify("test.adoc", expected, source, renderer.DefineMacro(helloMacroTmpl.Name(), helloMacroTmpl)) }) It("undefined inline macro", func() { @@ -73,7 +73,7 @@ var _ = Describe("user macros", func() { expected := `<div class="paragraph"> <p>hello:[]</p> </div>` - verify(expected, source) + verify("test.adoc", expected, source) }) It("inline macro", func() { @@ -82,7 +82,7 @@ var _ = Describe("user macros", func() { expected := `<div class="paragraph"> <p>AAA <span>hello world</span></p> </div>` - verify(expected, source, renderer.DefineMacro(helloMacroTmpl.Name(), helloMacroTmpl)) + verify("test.adoc", expected, source, renderer.DefineMacro(helloMacroTmpl.Name(), helloMacroTmpl)) }) It("inline macro with attribute", func() { @@ -91,7 +91,7 @@ var _ = Describe("user macros", func() { expected := `<div class="paragraph"> <p>AAA <span>hello world!!!!!</span></p> </div>` - verify(expected, source, renderer.DefineMacro(helloMacroTmpl.Name(), helloMacroTmpl)) + verify("test.adoc", expected, source, renderer.DefineMacro(helloMacroTmpl.Name(), helloMacroTmpl)) }) It("inline macro with value", func() { @@ -100,7 +100,7 @@ var _ = Describe("user macros", func() { expected := `<div class="paragraph"> <p>AAA <span>hello John Doe</span></p> </div>` - verify(expected, source, renderer.DefineMacro(helloMacroTmpl.Name(), helloMacroTmpl)) + verify("test.adoc", expected, source, renderer.DefineMacro(helloMacroTmpl.Name(), helloMacroTmpl)) }) It("inline macro with value and attributes", func() { @@ -109,7 +109,7 @@ var _ = Describe("user macros", func() { expected := `<div class="paragraph"> <p>AAA <span>Hi John Doe!!</span></p> </div>` - verify(expected, source, renderer.DefineMacro(helloMacroTmpl.Name(), helloMacroTmpl)) + verify("test.adoc", expected, source, renderer.DefineMacro(helloMacroTmpl.Name(), helloMacroTmpl)) }) })