Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use doctest: add doctests for message functions
- Loading branch information
1 parent
1c6400c
commit a870ede
Showing
10 changed files
with
63 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,17 @@ | |||
# Generated by doctest: do not edit by hand | |||
# Please edit file in R/rlang.R | |||
|
|||
test_that("Doctest: onetime-rlang", { | |||
# Created from @doctest for `onetime-rlang` | |||
# Source file: R/rlang.R | |||
# Source line: 11 | |||
oo <- options(onetime.dir = tempdir(check = TRUE)) | |||
id <- sample(10000L, 1) | |||
for (n in 1:3) { | |||
expect_warning(onetime_rlang_warn(c("rlang-style warning", i = "Extra info"), id = id), | |||
regexp = if (n == 1L) "rlang" else NA) | |||
} | |||
onetime_reset(id = id) | |||
options(oo) | |||
}) | |||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,15 @@ | |||
# Generated by doctest: do not edit by hand | |||
# Please edit file in R/messages.R | |||
|
|||
test_that("Doctest: onetime_message_confirm", { | |||
# Created from @doctest for `onetime_message_confirm` | |||
# Source file: R/messages.R | |||
# Source line: 110 | |||
oo <- options(onetime.dir = tempdir(check = TRUE)) | |||
id <- sample(10000L, 1L) | |||
expect_message(onetime_message_confirm("A message to show one or more times", id = id), | |||
"A message") | |||
onetime_reset(id = id) | |||
options(oo) | |||
}) | |||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,17 @@ | |||
# Generated by doctest: do not edit by hand | |||
# Please edit file in R/messages.R | |||
|
|||
test_that("Doctest: onetime_warning", { | |||
# Created from @doctest for `onetime_warning` | |||
# Source file: R/messages.R | |||
# Source line: 16 | |||
oo <- options(onetime.dir = tempdir(check = TRUE)) | |||
id <- sample(10000L, 1) | |||
for (n in 1:3) { | |||
expect_warning(onetime_warning("will be shown once", id = id), regexp = if (n == | |||
1L) "once" else NA) | |||
} | |||
onetime_reset(id = id) | |||
options(oo) | |||
}) | |||
|