Skip to content

Commit 23972b3

Browse files
script for generating roxygen-examples-complete
1 parent a6518fc commit 23972b3

31 files changed

+162
-152
lines changed

.dev/gen_roxygen_tests.R

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/Rscript
2+
# execute from package TLD: ./.dev/gen_roxygen_tests.R
3+
all_examples <- list.files("tests/testthat/roxygen-examples-complete", full.names = TRUE)
4+
unique_tests <- unique(sub("-.*", "", basename(all_examples)))
5+
6+
for (test in unique_tests) {
7+
out_file <- file.path("tests", "testthat", paste0("test-roxygen-examples-complete-", test, ".R"))
8+
extras <- if (test == "15") ', scope = "spaces"' else ""
9+
writeLines(con = out_file, c(
10+
"# NB: DO NOT EDIT. Auto-generated by .dev/gen_roxygen_tests.R.",
11+
"",
12+
sprintf('test_that("analogous to test-roxygen-examples-complete: %s", {', test),
13+
sprintf(' expect_warning(test_collection("roxygen-examples-complete", "^%s-", transformer = style_text%s), NA)', test, extras),
14+
"})",
15+
NULL
16+
))
17+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# NB: DO NOT EDIT. Auto-generated by .dev/gen_roxygen_tests.R.
2+
3+
test_that("analogous to test-roxygen-examples-complete: 01", {
4+
expect_warning(test_collection("roxygen-examples-complete", "^01-", transformer = style_text), NA)
5+
})
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# NB: DO NOT EDIT. Auto-generated by .dev/gen_roxygen_tests.R.
2+
3+
test_that("analogous to test-roxygen-examples-complete: 02", {
4+
expect_warning(test_collection("roxygen-examples-complete", "^02-", transformer = style_text), NA)
5+
})
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# NB: DO NOT EDIT. Auto-generated by .dev/gen_roxygen_tests.R.
2+
3+
test_that("analogous to test-roxygen-examples-complete: 03", {
4+
expect_warning(test_collection("roxygen-examples-complete", "^03-", transformer = style_text), NA)
5+
})
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# NB: DO NOT EDIT. Auto-generated by .dev/gen_roxygen_tests.R.
2+
3+
test_that("analogous to test-roxygen-examples-complete: 04", {
4+
expect_warning(test_collection("roxygen-examples-complete", "^04-", transformer = style_text), NA)
5+
})
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# NB: DO NOT EDIT. Auto-generated by .dev/gen_roxygen_tests.R.
2+
3+
test_that("analogous to test-roxygen-examples-complete: 05", {
4+
expect_warning(test_collection("roxygen-examples-complete", "^05-", transformer = style_text), NA)
5+
})
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# NB: DO NOT EDIT. Auto-generated by .dev/gen_roxygen_tests.R.
2+
3+
test_that("analogous to test-roxygen-examples-complete: 06", {
4+
expect_warning(test_collection("roxygen-examples-complete", "^06-", transformer = style_text), NA)
5+
})
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# NB: DO NOT EDIT. Auto-generated by .dev/gen_roxygen_tests.R.
2+
3+
test_that("analogous to test-roxygen-examples-complete: 07", {
4+
expect_warning(test_collection("roxygen-examples-complete", "^07-", transformer = style_text), NA)
5+
})
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# NB: DO NOT EDIT. Auto-generated by .dev/gen_roxygen_tests.R.
2+
3+
test_that("analogous to test-roxygen-examples-complete: 08", {
4+
expect_warning(test_collection("roxygen-examples-complete", "^08-", transformer = style_text), NA)
5+
})
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# NB: DO NOT EDIT. Auto-generated by .dev/gen_roxygen_tests.R.
2+
3+
test_that("analogous to test-roxygen-examples-complete: 09", {
4+
expect_warning(test_collection("roxygen-examples-complete", "^09-", transformer = style_text), NA)
5+
})

0 commit comments

Comments
 (0)