From 3bfd0704d4f49ddb5caefe71f71fc65ed080816d Mon Sep 17 00:00:00 2001 From: Jackson Hoffart Date: Wed, 7 Feb 2024 18:09:01 +0100 Subject: [PATCH] Include all `demo` datasets (#335) --- tests/testthat/test-data_dictionary.R | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test-data_dictionary.R b/tests/testthat/test-data_dictionary.R index 7ccd9342..7ca5d077 100644 --- a/tests/testthat/test-data_dictionary.R +++ b/tests/testthat/test-data_dictionary.R @@ -26,8 +26,11 @@ test_that("defines all its names", { test_that("includes suffix _demo", { dd <- data_dictionary$dataset - expect_true("ald_demo" %in% dd) - expect_true("loanbook_demo" %in% dd) + datasets <- enlist_datasets("r2dii.data") + + for (dataset in grep("_demo$", names(datasets), value = TRUE)) { + expect_true(dataset %in% dd) + } }) test_that("outputs as many rows per `dataset` as columns in `dataset`", {