Skip to content

Commit

Permalink
Added tests for the new "non_existing" options
Browse files Browse the repository at this point in the history
* Test "11" ensures that non-existing keys are replaced with the key itself when the option is set to "key" (e.g., '\acr{RL}' becomes 'RL').
* Test "12" ensures that non-existing keys are replaced with "??" when the option is set to "??".
  • Loading branch information
rchaput committed Jan 9, 2022
1 parent 08060ca commit 813cc09
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: acronymsdown
Type: Package
Title: Acronyms and Glossaries Support for RMarkdown
Version: 0.8.0
Version: 0.9.0
Author: Remy Chaput
Maintainer: remy chaput <rchaput.pro@gmail.com>
Description: Adds support for list of acronyms (or glossaries) for RMarkdown
Expand Down
7 changes: 7 additions & 0 deletions tests/11-missing-key/expected.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# List Of Acronyms {#acronyms_HEADER_LOA .loa}

# Introduction {#intro}

This paragraph mentions RL for the first time.

And now, in this paragraph, RL is in short form.
16 changes: 16 additions & 0 deletions tests/11-missing-key/input.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
output:
md_document:
pandoc_args:
- !expr acronymsdown::add_filter()
- --wrap=preserve
variant: markdown
acronyms:
non_existing: "key"
---

# Introduction {#intro}

This paragraph mentions \acr{RL} for the first time.

And now, in this paragraph, \acr{RL} is in short form.
7 changes: 7 additions & 0 deletions tests/12-missing-??/expected.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# List Of Acronyms {#acronyms_HEADER_LOA .loa}

# Introduction {#intro}

This paragraph mentions ?? for the first time.

And now, in this paragraph, ?? is in short form.
16 changes: 16 additions & 0 deletions tests/12-missing-??/input.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
output:
md_document:
pandoc_args:
- !expr acronymsdown::add_filter()
- --wrap=preserve
variant: markdown
acronyms:
non_existing: "??"
---

# Introduction {#intro}

This paragraph mentions \acr{RL} for the first time.

And now, in this paragraph, \acr{RL} is in short form.
4 changes: 3 additions & 1 deletion tests/test_rmarkdown.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ folders <- c(
"07-multiple-external-yaml",
"08-style-short-long",
"09-style-footnote",
"10-no-links"
"10-no-links",
"11-missing-key",
"12-missing-??"
)

for (folder in folders) {
Expand Down

0 comments on commit 813cc09

Please sign in to comment.