From e7a3afeff72432514448a2a3a99c5a9023bc4acf Mon Sep 17 00:00:00 2001 From: Fonti Kar Date: Thu, 19 Dec 2024 11:40:22 +1100 Subject: [PATCH] Checks for missingness #139 --- R/extract_data.R | 3 +++ tests/testthat/test-extract_.R | 2 ++ 2 files changed, 5 insertions(+) diff --git a/R/extract_data.R b/R/extract_data.R index 42d7086..fe1ce8a 100644 --- a/R/extract_data.R +++ b/R/extract_data.R @@ -21,6 +21,9 @@ #' } extract_data <- function(database, table = NA, col, col_value) { + # Check missingness + check_arg_missingness(database, col, col_value) + # Check compatability status <- check_compatibility(database, single_table_allowed = TRUE) diff --git a/tests/testthat/test-extract_.R b/tests/testthat/test-extract_.R index c30ef77..313624b 100644 --- a/tests/testthat/test-extract_.R +++ b/tests/testthat/test-extract_.R @@ -10,6 +10,8 @@ taxon_name = "Banskia serrata" test_that("Error message is triggered", { expect_error(austraits_5.0.0_lite %>% extract_taxa()) + expect_error(extract_taxa()) + expect_error(extract_data(at_six)) }) test_extract_error <- function(austraits){