Browse Source

Added tests

pull/307/head
Wandmalfarbe 2 years ago
parent
commit
87923d0468
  1. 2
      .gitignore
  2. BIN
      examples/basic-example/document.pdf
  3. BIN
      examples/beamer/document.pdf
  4. BIN
      examples/book/document.pdf
  5. BIN
      examples/boxes-with-pandoc-latex-environment-and-awesomebox/document.pdf
  6. BIN
      examples/boxes-with-pandoc-latex-environment-and-tcolorbox/document.pdf
  7. 2
      examples/build-examples.sh
  8. BIN
      examples/code-blocks-listings/document.pdf
  9. BIN
      examples/code-blocks-without-listings/document.pdf
  10. BIN
      examples/code-blocks-without-listings/preview.png
  11. BIN
      examples/header-and-footer/document.pdf
  12. BIN
      examples/images-and-tables/document.pdf
  13. BIN
      examples/images-and-tables/preview.png
  14. BIN
      examples/language-german/document.pdf
  15. BIN
      examples/language-japanese/document.pdf
  16. BIN
      examples/page-background/document.pdf
  17. BIN
      examples/table-of-contents/document.pdf
  18. BIN
      examples/table-of-contents/preview.png
  19. BIN
      examples/title-page-background/document.pdf
  20. BIN
      examples/title-page-custom/document.pdf
  21. BIN
      examples/title-page-default/document.pdf
  22. BIN
      examples/title-page-green/document.pdf
  23. BIN
      examples/title-page-logo/document.pdf
  24. 38
      tests/build-tests.sh
  25. 1
      tests/heading/build.sh
  26. 32
      tests/heading/document.md
  27. BIN
      tests/heading/document.pdf
  28. BIN
      tests/heading/preview.png
  29. 1
      tests/horizontal-rule/build.sh
  30. 28
      tests/horizontal-rule/document.md
  31. BIN
      tests/horizontal-rule/document.pdf
  32. BIN
      tests/horizontal-rule/preview.png
  33. 1
      tests/list-definition/build.sh
  34. 29
      tests/list-definition/document.md
  35. BIN
      tests/list-definition/document.pdf
  36. BIN
      tests/list-definition/preview.png
  37. 1
      tests/list-ordered/build.sh
  38. 43
      tests/list-ordered/document.md
  39. BIN
      tests/list-ordered/document.pdf
  40. BIN
      tests/list-ordered/preview.png
  41. 1
      tests/list-task/build.sh
  42. 34
      tests/list-task/document.md
  43. BIN
      tests/list-task/document.pdf
  44. BIN
      tests/list-task/preview.png
  45. 1
      tests/list-unordered/build.sh
  46. 43
      tests/list-unordered/document.md
  47. BIN
      tests/list-unordered/document.pdf
  48. BIN
      tests/list-unordered/preview.png

2
.gitignore

@ -5,6 +5,8 @@ private/
# build folder
dist/
.idea
# contains unit tests (incomplete at the moment, so don't include them)
test/
test/.idea/

BIN
examples/basic-example/document.pdf

Binary file not shown.

BIN
examples/beamer/document.pdf

Binary file not shown.

BIN
examples/book/document.pdf

Binary file not shown.

BIN
examples/boxes-with-pandoc-latex-environment-and-awesomebox/document.pdf

Binary file not shown.

BIN
examples/boxes-with-pandoc-latex-environment-and-tcolorbox/document.pdf

Binary file not shown.

2
examples/build-examples.sh

@ -14,7 +14,7 @@ containsElement () {
}
# these examples are skipped because they don't run on travis (for now)
skippedExamples=("language-chinese" "language-japanese")
skippedExamples=("language-chinese" "language-japanese", "language-persian")
# loop all files in the current folder
for f in *; do

BIN
examples/code-blocks-listings/document.pdf

Binary file not shown.

BIN
examples/code-blocks-without-listings/document.pdf

Binary file not shown.

BIN
examples/code-blocks-without-listings/preview.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 KiB

After

Width:  |  Height:  |  Size: 168 KiB

BIN
examples/header-and-footer/document.pdf

Binary file not shown.

BIN
examples/images-and-tables/document.pdf

Binary file not shown.

BIN
examples/images-and-tables/preview.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 462 KiB

After

Width:  |  Height:  |  Size: 466 KiB

BIN
examples/language-german/document.pdf

Binary file not shown.

BIN
examples/language-japanese/document.pdf

Binary file not shown.

BIN
examples/page-background/document.pdf

Binary file not shown.

BIN
examples/table-of-contents/document.pdf

Binary file not shown.

BIN
examples/table-of-contents/preview.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 265 KiB

After

Width:  |  Height:  |  Size: 265 KiB

BIN
examples/title-page-background/document.pdf

Binary file not shown.

BIN
examples/title-page-custom/document.pdf

Binary file not shown.

BIN
examples/title-page-default/document.pdf

Binary file not shown.

BIN
examples/title-page-green/document.pdf

Binary file not shown.

BIN
examples/title-page-logo/document.pdf

Binary file not shown.

38
tests/build-tests.sh

@ -0,0 +1,38 @@
#!/bin/bash
set -e
echo "##"
echo "# building tests"
echo "##"
echo ""
containsElement () {
local e match="$1"
shift
for e; do [[ "$e" == "$match" ]] && return 0; done
return 1
}
# these examples are skipped because they don't run on travis (for now)
skippedExamples=()
# loop all files in the current folder
for f in *; do
# run only for folders
if [ -d "$f" ]; then
if containsElement "$f" "${skippedExamples[@]}"; then
echo "skipping '$f'"
echo ""
else
echo "building '$f'"
cd "$f"
echo " - running pandoc build script"
bash "$PWD/build.sh"
echo " - generating preview"
pdftoppm -r 150 -png "document.pdf" > "preview.png"
echo ""
cd ".."
fi
fi
done

1
tests/heading/build.sh

@ -0,0 +1 @@
pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings

32
tests/heading/document.md

@ -0,0 +1,32 @@
---
title: "Test: Heading"
author: [Author]
date: "2022-11-24"
subject: "Markdown"
keywords: [Markdown, Example, Text, Heading]
lang: "en"
...
# Test: Heading
## Setext-style headings
level one
=========
level two
---------
## ATX-style headings
# level one
## level two
### level three
#### level four
##### level five
###### level six

BIN
tests/heading/document.pdf

Binary file not shown.

BIN
tests/heading/preview.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

1
tests/horizontal-rule/build.sh

@ -0,0 +1 @@
pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings

28
tests/horizontal-rule/document.md

@ -0,0 +1,28 @@
---
title: "Test: Horizontal Rule"
author: [Author]
date: "2022-11-24"
subject: "Markdown"
keywords: [Markdown, Example, Text, Horizontal Rule]
lang: "en"
...
# Test: Horizontal Rule
## Horizontal Rule with `*` (asterisk)
****
**********
## Horizontal Rule with `-` (minus)
----
----------
## Horizontal Rule with `_` (underscore)
____
__________

BIN
tests/horizontal-rule/document.pdf

Binary file not shown.

BIN
tests/horizontal-rule/preview.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

1
tests/list-definition/build.sh

@ -0,0 +1 @@
pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings

29
tests/list-definition/document.md

@ -0,0 +1,29 @@
---
title: "Test: Definition List"
author: [Author]
date: "2022-11-24"
subject: "Markdown"
keywords: [Markdown, Example, Text, List, Definition List]
lang: "en"
...
# Test: Definition List
## Definition List with single definition
Apple
: Pomaceous fruit of plants of the genus Malus in
the family Rosaceae.
Orange
: The fruit of an evergreen tree of the genus Citrus.
## Definition List with multiple definitions
Apple
: Pomaceous fruit of plants of the genus Malus in
the family Rosaceae.
: An American computer company.
Orange
: The fruit of an evergreen tree of the genus Citrus.

BIN
tests/list-definition/document.pdf

Binary file not shown.

BIN
tests/list-definition/preview.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

1
tests/list-ordered/build.sh

@ -0,0 +1 @@
pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings

43
tests/list-ordered/document.md

@ -0,0 +1,43 @@
---
title: "Lists"
author: [Author]
date: "2022-11-24"
subject: "Markdown"
keywords: [Markdown, Example, Text, List, Ordered List]
lang: "en"
...
# Test: Lists
## Ordered list with number and period
2. two
3. three
4. four
## Ordered list with number and bracket
8) eight
9) nine
10) ten
## Ordered list with roman numerals
II. one
III. two
IV. three
## Ordered nested list
1. one
1) orange
2) apple
* pine
* maple
3) orange
2. two
1. sunny
II. two
III. three
IV. four
2. rainy

BIN
tests/list-ordered/document.pdf

Binary file not shown.

BIN
tests/list-ordered/preview.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

1
tests/list-task/build.sh

@ -0,0 +1 @@
pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings

34
tests/list-task/document.md

@ -0,0 +1,34 @@
---
title: "Test: Task List"
author: [Author]
date: "2022-11-24"
subject: "Markdown"
keywords: [Markdown, Example, Text, List, Task List]
lang: "en"
...
# Test: Task List
## Task list unchecked
- [ ] one
- [ ] two
- [ ] three
## Task list checked
- [x] one
- [x] two
- [x] three
## Task list nested
- [x] one
- [ ] orange
- [ ] apple
- [x] pine
- [x] maple
- [ ] mango
- [ ] two
- [x] sunny
- [ ] rainy

BIN
tests/list-task/document.pdf

Binary file not shown.

BIN
tests/list-task/preview.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

1
tests/list-unordered/build.sh

@ -0,0 +1 @@
pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings

43
tests/list-unordered/document.md

@ -0,0 +1,43 @@
---
title: "List Unordered"
author: [Author]
date: "2022-11-24"
subject: "Markdown"
keywords: [Markdown, Example, Text, List, Unordered List]
lang: "en"
...
# Test: List Unordered
## Unordered list with dash
- one
- two
- three
## Unordered list with asterisk
* one
* two
* three
## Unordered list with plus sign
+ one
+ two
+ three
## Unordered nested list
- one
- orange
- apple
* pine
* maple
- orange
- two
+ sunny
* four
* five
* six
+ rainy

BIN
tests/list-unordered/document.pdf

Binary file not shown.

BIN
tests/list-unordered/preview.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Loading…
Cancel
Save