Skip to content

Commit

Permalink
Added tests for the styles.
Browse files Browse the repository at this point in the history
* Test 08 checks that style "short-long" works correctly.
* Test 09 checks that style "short-footnote" works correctly.
* The default style ("long-short") is already covered by other tests.
  • Loading branch information
rchaput committed Jan 1, 2022
1 parent 6a16235 commit 9ed3698
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/08-style-short-long/expected.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# List Of Acronyms {#acronyms_HEADER_LOA .loa}

[RL]{#acronyms_RL}
: Reinforcement Learning

# Introduction {#intro}

This paragraph mentions [RL (Reinforcement Learning)](#acronyms_RL) for
the first time.

And now, in this paragraph, [RL](#acronyms_RL) is in short form.
17 changes: 17 additions & 0 deletions tests/08-style-short-long/input.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
output:
md_document:
pandoc_args: !expr acronymsdown::add_filter()
variant: markdown
acronyms:
style: short-long
keys:
- shortname: RL
longname: Reinforcement Learning
---

# Introduction {#intro}

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

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

[RL]{#acronyms_RL}
: Reinforcement Learning

# Introduction {#intro}

This paragraph mentions RL[^1] for the first time.

And now, in this paragraph, [RL](#acronyms_RL) is in short form.

[^1]: [RL](#acronyms_RL): Reinforcement Learning
17 changes: 17 additions & 0 deletions tests/09-style-footnote/input.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
output:
md_document:
pandoc_args: !expr acronymsdown::add_filter()
variant: markdown
acronyms:
style: short-footnote
keys:
- shortname: RL
longname: Reinforcement Learning
---

# Introduction {#intro}

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

And now, in this paragraph, \acr{RL} is in short form.
8 changes: 8 additions & 0 deletions tests/testthat.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,11 @@ testthat::test_that("06-external-yaml", {
testthat::test_that("07-multiple-external-yaml", {
test_dir("07-multiple-external-yaml")
})

testthat::test_that("08-style-short-long", {
test_dir("08-style-short-long")
})

testthat::test_that("09-style-footnote", {
test_dir("09-style-footnote")
})

0 comments on commit 9ed3698

Please sign in to comment.