From 997900eac19f90a255823d82e52244dd0e76913f Mon Sep 17 00:00:00 2001 From: Bastien Dumont Date: Sun, 12 Jun 2022 12:33:43 +0200 Subject: [PATCH] Added test with sample file --- margin-notes/Makefile | 6 +- margin-notes/test/sample.native | 120 ++++++++++++++++++++++++++++++++ 2 files changed, 123 insertions(+), 3 deletions(-) create mode 100644 margin-notes/test/sample.native diff --git a/margin-notes/Makefile b/margin-notes/Makefile index 67fcc04..f808fac 100644 --- a/margin-notes/Makefile +++ b/margin-notes/Makefile @@ -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 diff --git a/margin-notes/test/sample.native b/margin-notes/test/sample.native new file mode 100644 index 0000000..712299d --- /dev/null +++ b/margin-notes/test/sample.native @@ -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)" + ] +]