Added test with sample file

This commit is contained in:
Bastien Dumont 2022-06-12 12:33:43 +02:00
parent 7853500bca
commit 997900eac1
2 changed files with 123 additions and 3 deletions

View File

@ -15,9 +15,9 @@ test-internal: margin-notes.lua test/test-functions.lua
@echo -e '==========================\nAll internal tests passed.\n==========================\n'
rm --interactive=never test/tmp.lua
test: margin-notes.lua test/test.md
pandoc -t native -L margin-notes.lua test/test.md > test/tmp.native
diff test/tmp.native test/test.native
test: margin-notes.lua sample.md
pandoc -t native -L margin-notes.lua sample.md > test/tmp.native
diff test/tmp.native test/sample.native
@echo -e '\n===============\ntest passed.\n===============\n'
rm test/tmp.native

View File

@ -0,0 +1,120 @@
[ Para
[ Span ( "" , [ "warning" ] , [] ) []
, Strong [ Str "Important!" ]
, Str "You"
, Space
, Str "can"
, Space
, Str "use"
, Space
, Str "LaTeX"
, Space
, Str "to"
, Space
, Str "include"
, SoftBreak
, Span
( ""
, [ "term" ]
, [ ( "lem" , "BibTeX" )
, ( "def"
, "A program designed to format bibliographical entries"
)
]
)
[ Strong [ Str "BibTeX" ] ]
, Str "BibTeX:"
, Space
, Emph
[ Str "A"
, Space
, Str "program"
, Space
, Str "designed"
, Space
, Str "to"
, Space
, Str "format"
, Space
, Str "bibliographical"
, Space
, Str "entries"
]
, Space
, Str "citations."
, Space
, Str "Note"
, Space
, Str "that"
, Space
, Str "in"
, Space
, Str "LaTeX"
, Space
, Str "environments,"
, SoftBreak
, Str "the"
, Space
, Str "material"
, Space
, Str "between"
, Space
, Str "the"
, Space
, Str "begin"
, Space
, Str "and"
, Space
, Str "end"
, Space
, Str "tags"
, Space
, Str "will"
, Space
, Str "be"
, Space
, Str "interpreted"
, SoftBreak
, Str "as"
, Space
, Span
( ""
, [ "term" ]
, [ ( "lem" , "Raw code" )
, ( "def" , "Code inserted **untouched** in the output." )
]
)
[ Strong [ Str "raw" , Space , Str "LaTeX" ] ]
, Str "Raw"
, Space
, Str "code:"
, Space
, Emph
[ Str "Code"
, Space
, Str "inserted"
, Space
, Strong [ Str "untouched" ]
, Space
, Str "in"
, Space
, Str "the"
, Space
, Str "output."
]
, Str ","
, Space
, Str "not"
, Space
, Str "as"
, Space
, Str "Markdown."
]
, Para
[ Str "(From"
, Space
, Str "Pandoc"
, Space
, Str "manual)"
]
]