From e8a7ef93a5095303302a7abb17c62348de4e2bc2 Mon Sep 17 00:00:00 2001 From: Zelos Zhu Date: Fri, 6 Oct 2023 16:21:57 +0000 Subject: [PATCH] forgot test suite --- tests/testthat/test-compute_kidney.R | 10 -- tests/testthat/test-derive_extreme_records.R | 78 ---------- tests/testthat/test-derive_merged.R | 145 ++++-------------- tests/testthat/test-derive_param_computed.R | 47 +----- tests/testthat/test-derive_param_exist_flag.R | 42 ----- tests/testthat/test-derive_var_dthcaus.R | 13 -- tests/testthat/test-derive_var_extreme_date.R | 10 -- tests/testthat/test-derive_var_ontrtfl.R | 16 -- tests/testthat/test-derive_var_shift.R | 8 - 9 files changed, 35 insertions(+), 334 deletions(-) diff --git a/tests/testthat/test-compute_kidney.R b/tests/testthat/test-compute_kidney.R index 6fd5d26690..b0739f11e9 100644 --- a/tests/testthat/test-compute_kidney.R +++ b/tests/testthat/test-compute_kidney.R @@ -100,15 +100,6 @@ test_that("compute_egfr Test 7: CKD-EPI calculated on input data", { ) }) -<<<<<<< HEAD -## Test 8: Deprecate wt ---- -test_that("compute_egfr Test 8: 'wt' argument deprecation warning", { - # expect deprecation warning - expect_warning( - compute_egfr( - creat = 1.09, creatu = "mg/dL", age = 55, sex = "M", wt = 90, method = "CRCL" - ) -======= ## Test 8: 'wt' argument deprecation warning ---- test_that("compute_egfr Test 8: 'wt' argument deprecation warning", { # expect deprecation warning @@ -117,6 +108,5 @@ test_that("compute_egfr Test 8: 'wt' argument deprecation warning", { creat = 1.09, creatu = "mg/dL", age = 55, sex = "M", wt = 90, method = "CRCL" ), class = "lifecycle_error_deprecated" ->>>>>>> b800ab103ddbf55701d4f6b2ed0080d3c3525f27 ) }) diff --git a/tests/testthat/test-derive_extreme_records.R b/tests/testthat/test-derive_extreme_records.R index 85f253ca93..b3531cbad4 100644 --- a/tests/testthat/test-derive_extreme_records.R +++ b/tests/testthat/test-derive_extreme_records.R @@ -299,76 +299,8 @@ test_that("derive_extreme_records Test 5: latest evaluable tumor assessment date ) }) -<<<<<<< HEAD -## Test 6: warning if filter argument is used ---- -test_that("derive_extreme_records Test 6: warning if filter argument is used", { - adsl <- tibble::tribble( - ~USUBJID, - "1", - "2", - "3" - ) %>% - mutate(STUDYID = "XX1234") - - adrs <- tibble::tribble( - ~USUBJID, ~ADTC, ~AVALC, ~PARAMCD, - "1", "2020-01-02", "PR", "OVR", - "1", "2020-02-01", "CR", "OVR", - "1", "2020-03-01", "NE", "OVR", - "1", "2020-04-01", "SD", "OVR", - "2", "2021-06-15", "SD", "OVR", - "2", "2021-07-16", "SD", "OVR", - "2", "2021-09-14", "NE", "OVR", - "3", "2021-08-03", "NE", "OVR", - ) %>% - mutate( - STUDYID = "XX1234", - ADT = ymd(ADTC) - ) %>% - select(-ADTC) - - actual <- derive_extreme_records( - adrs, - dataset_ref = adsl, - dataset_add = adrs, - by_vars = exprs(USUBJID), - filter_add = PARAMCD == "OVR" & AVALC == "PD", - exist_flag = AVALC, - order = exprs(ADT), - mode = "first", - set_values_to = exprs( - PARAMCD = "PD", - ANL01FL = "Y", - ADT = ADT - ) - ) - - expect_error( - derive_extreme_records( - adrs, - dataset_ref = adsl, - dataset_add = adrs, - by_vars = exprs(USUBJID), - filter = PARAMCD == "OVR" & AVALC == "PD", - exist_flag = AVALC, - order = exprs(ADT), - mode = "first", - set_values_to = exprs( - PARAMCD = "PD", - ANL01FL = "Y", - ADT = ADT - ) - ), - class = "lifecycle_error_deprecated" - ) -}) - -## Test 7: error if no input data ---- -test_that("derive_extreme_records Test 7: error if no input data", { -======= ## Test 6: error if no input data ---- test_that("derive_extreme_records Test 6: error if no input data", { ->>>>>>> b800ab103ddbf55701d4f6b2ed0080d3c3525f27 expect_error( derive_extreme_records( set_values_to = exprs(PARAMCD = "HELLO") @@ -382,13 +314,8 @@ test_that("derive_extreme_records Test 6: error if no input data", { ) }) -<<<<<<< HEAD -## Test 8: keep vars in `keep_source_vars` in the new records ---- -test_that("derive_extreme_records Test 8: keep vars in `keep_source_vars` in the new records", { -======= ## Test 7: keep vars in `keep_source_vars` in the new records ---- test_that("derive_extreme_records Test 7: keep vars in `keep_source_vars` in the new records", { ->>>>>>> b800ab103ddbf55701d4f6b2ed0080d3c3525f27 input <- tibble::tribble( ~USUBJID, ~AVISITN, ~AVAL, ~LBSEQ, 1, 1, 12, 1, @@ -426,13 +353,8 @@ test_that("derive_extreme_records Test 7: keep vars in `keep_source_vars` in the ) }) -<<<<<<< HEAD -## Test 9: keep all vars in the new records when `keep_source_vars` is 'exprs(everything())' ---- -test_that("derive_extreme_records Test 9: keep all vars in the new records when `keep_source_vars` is 'exprs(everything())'", { # nolint -======= ## Test 8: keep all vars in the new records when `keep_source_vars` is 'exprs(everything())' ---- test_that("derive_extreme_records Test 8: keep all vars in the new records when `keep_source_vars` is 'exprs(everything())'", { # nolint ->>>>>>> b800ab103ddbf55701d4f6b2ed0080d3c3525f27 input <- tibble::tribble( ~USUBJID, ~AVISITN, ~AVAL, ~LBSEQ, 1, 1, 12, 1, diff --git a/tests/testthat/test-derive_merged.R b/tests/testthat/test-derive_merged.R index af7f7216a3..e78383f89a 100644 --- a/tests/testthat/test-derive_merged.R +++ b/tests/testthat/test-derive_merged.R @@ -65,8 +65,8 @@ vs <- tibble::tribble( ## Test 1: merge all variables ---- test_that("derive_vars_merged Test 1: merge all variables", { actual <- derive_vars_merged(advs, - dataset_add = adsl, - by_vars = exprs(STUDYID, USUBJID) + dataset_add = adsl, + by_vars = exprs(STUDYID, USUBJID) ) expected <- left_join(advs, adsl, by = c("STUDYID", "USUBJID")) @@ -81,9 +81,9 @@ test_that("derive_vars_merged Test 1: merge all variables", { ## Test 2: merge selected variables ---- test_that("derive_vars_merged Test 2: merge selected variables", { actual <- derive_vars_merged(advs, - dataset_add = adsl, - by_vars = exprs(USUBJID), - new_vars = exprs(SEX) + dataset_add = adsl, + by_vars = exprs(USUBJID), + new_vars = exprs(SEX) ) expected <- left_join(advs, select(adsl, USUBJID, SEX), by = "USUBJID") @@ -98,12 +98,12 @@ test_that("derive_vars_merged Test 2: merge selected variables", { ## Test 3: merge last value and flag matched by groups ---- test_that("derive_vars_merged Test 3: merge last value and flag matched by groups", { actual <- derive_vars_merged(adsl, - dataset_add = advs, - order = exprs(AVAL), - by_vars = exprs(STUDYID, USUBJID), - new_vars = exprs(WEIGHTBL = AVAL), - mode = "last", - match_flag = matched + dataset_add = advs, + order = exprs(AVAL), + by_vars = exprs(STUDYID, USUBJID), + new_vars = exprs(WEIGHTBL = AVAL), + mode = "last", + match_flag = matched ) expected <- adsl %>% mutate( WEIGHTBL = c(68, 88, 55, NA), @@ -121,8 +121,8 @@ test_that("derive_vars_merged Test 3: merge last value and flag matched by group test_that("derive_vars_merged Test 4: error if variable in both datasets", { expect_error( derive_vars_merged(advs, - dataset_add = adsl, - by_vars = exprs(USUBJID) + dataset_add = adsl, + by_vars = exprs(USUBJID) ), regexp = "" ) @@ -131,9 +131,9 @@ test_that("derive_vars_merged Test 4: error if variable in both datasets", { ## Test 5: by_vars with rename ---- test_that("derive_vars_merged Test 5: by_vars with rename", { actual <- derive_vars_merged(advs, - dataset_add = adsl1, - by_vars = exprs(STUDYID, USUBJID = ID), - filter_add = SEX == "F" + dataset_add = adsl1, + by_vars = exprs(STUDYID, USUBJID = ID), + filter_add = SEX == "F" ) adsl_1 <- adsl1 %>% filter(SEX == "F") @@ -212,11 +212,11 @@ test_that("derive_vars_merged Test 7: use new variables in filter_add and order" test_that("derive_vars_merged Test 8: warning if not unique w.r.t the by variables and the order", { expect_warning( actual <- derive_vars_merged(advs, - dataset_add = adsl2, - by_vars = exprs(STUDYID, USUBJID = ID), - order = exprs(ID), - mode = "last", - check_type = "warning" + dataset_add = adsl2, + by_vars = exprs(STUDYID, USUBJID = ID), + order = exprs(ID), + mode = "last", + check_type = "warning" ), regexp = "" ) @@ -226,12 +226,12 @@ test_that("derive_vars_merged Test 8: warning if not unique w.r.t the by variabl test_that("derive_vars_merged Test 9: error if not unique w.r.t the by variables and the order", { expect_error( actual <- derive_vars_merged(advs, - dataset_add = adsl2, - by_vars = exprs(STUDYID, USUBJID = ID), - order = exprs(ID), - mode = "last", - check_type = "error", - duplicate_msg = "Duplicate records present!" + dataset_add = adsl2, + by_vars = exprs(STUDYID, USUBJID = ID), + order = exprs(ID), + mode = "last", + check_type = "error", + duplicate_msg = "Duplicate records present!" ), regexp = "" ) @@ -254,40 +254,9 @@ test_that("derive_vars_merged Test 10: error if variables in missing_values but ) }) -<<<<<<< HEAD -# derive_var_merged_cat ---- - -## Test 11: deprecation error ---- -test_that("derive_var_merged_cat Test 11: deprecation error", { - get_vscat <- function(x) { - if_else(x == "BASELINE", "BASELINE", "POST-BASELINE") - } - - expect_error( - derive_var_merged_cat( - adsl, - dataset_add = advs, - by_vars = exprs(USUBJID), - new_var = LSTVSCAT, - source_var = AVISIT, - cat_fun = get_vscat, - order = exprs(AVISIT), - mode = "last", - missing_value = "MISSING" - ), - class = "lifecycle_error_deprecated" - ) -}) - - -# derive_var_merged_exist_flag ---- -## Test 12: merge existence flag ---- -test_that("derive_var_merged_exist_flag Test 12: merge existence flag", { -======= # derive_var_merged_exist_flag ---- ## Test 11: merge existence flag ---- test_that("derive_var_merged_exist_flag Test 11: merge existence flag", { ->>>>>>> b800ab103ddbf55701d4f6b2ed0080d3c3525f27 actual <- derive_var_merged_exist_flag( adsl, dataset_add = advs, @@ -307,13 +276,8 @@ test_that("derive_var_merged_exist_flag Test 11: merge existence flag", { ) }) -<<<<<<< HEAD -## Test 13: by_vars with rename ---- -test_that("derive_var_merged_exist_flag Test 13: by_vars with rename", { -======= ## Test 12: by_vars with rename ---- test_that("derive_var_merged_exist_flag Test 12: by_vars with rename", { ->>>>>>> b800ab103ddbf55701d4f6b2ed0080d3c3525f27 actual <- derive_var_merged_exist_flag( adsl, dataset_add = advs1, @@ -333,34 +297,9 @@ test_that("derive_var_merged_exist_flag Test 12: by_vars with rename", { ) }) -<<<<<<< HEAD -# derive_var_merged_character ---- - -## Test 14: deprecation error ---- -test_that("derive_var_merged_character Test 14: deprecation error", { - expect_error( - derive_var_merged_character( - adsl, - dataset_add = advs, - by_vars = exprs(USUBJID), - order = exprs(AVISIT), - new_var = LASTVIS, - source_var = AVISIT, - mode = "last" - ), - class = "lifecycle_error_deprecated" - ) -}) - - -# derive_vars_merged_lookup ---- -## Test 15: merge lookup table ---- -test_that("derive_vars_merged_lookup Test 15: merge lookup table", { -======= # derive_vars_merged_lookup ---- ## Test 13: merge lookup table ---- test_that("derive_vars_merged_lookup Test 13: merge lookup table", { ->>>>>>> b800ab103ddbf55701d4f6b2ed0080d3c3525f27 param_lookup <- tibble::tribble( ~VSTESTCD, ~VSTEST, ~PARAMCD, ~DESCRIPTION, "WEIGHT", "Weight", "WEIGHT", "Weight (kg)", @@ -397,13 +336,8 @@ test_that("derive_vars_merged_lookup Test 13: merge lookup table", { ## the lookup table -<<<<<<< HEAD -## Test 16: all by_vars have records in the lookup table ---- -test_that("derive_vars_merged_lookup Test 16: all by_vars have records in the lookup table", { -======= ## Test 14: all by_vars have records in the lookup table ---- test_that("derive_vars_merged_lookup Test 14: all by_vars have records in the lookup table", { ->>>>>>> b800ab103ddbf55701d4f6b2ed0080d3c3525f27 param_lookup <- tibble::tribble( ~VSTESTCD, ~VSTEST, ~PARAMCD, ~DESCRIPTION, "WEIGHT", "Weight", "WEIGHT", "Weight (kg)", @@ -438,13 +372,8 @@ test_that("derive_vars_merged_lookup Test 14: all by_vars have records in the l ) }) -<<<<<<< HEAD -## Test 17: by_vars with rename ---- -test_that("derive_vars_merged_lookup Test 17: by_vars with rename", { -======= ## Test 15: by_vars with rename ---- test_that("derive_vars_merged_lookup Test 15: by_vars with rename", { ->>>>>>> b800ab103ddbf55701d4f6b2ed0080d3c3525f27 param_lookup <- tibble::tribble( ~TESTCD, ~VSTEST, ~PARAMCD, ~DESCRIPTION, "WEIGHT", "Weight", "WEIGHT", "Weight (kg)", @@ -480,13 +409,8 @@ test_that("derive_vars_merged_lookup Test 15: by_vars with rename", { # get_not_mapped ---- -<<<<<<< HEAD -## Test 18: not all by_vars have records in the lookup table ---- -test_that("get_not_mapped Test 18: not all by_vars have records in the lookup table", { -======= ## Test 16: not all by_vars have records in the lookup table ---- test_that("get_not_mapped Test 16: not all by_vars have records in the lookup table", { ->>>>>>> b800ab103ddbf55701d4f6b2ed0080d3c3525f27 param_lookup <- tibble::tribble( ~VSTESTCD, ~VSTEST, ~PARAMCD, ~DESCRIPTION, "WEIGHT", "Weight", "WEIGHT", "Weight (kg)", @@ -524,13 +448,8 @@ test_that("get_not_mapped Test 16: not all by_vars have records in the lookup ta }) # derive_var_merged_summary ---- -<<<<<<< HEAD -## Test 19: dataset == dataset_add, no filter ---- -test_that("derive_var_merged_summary Test 19: dataset == dataset_add, no filter", { -======= ## Test 17: dataset == dataset_add, no filter ---- test_that("derive_var_merged_summary Test 17: dataset == dataset_add, no filter", { ->>>>>>> b800ab103ddbf55701d4f6b2ed0080d3c3525f27 expected <- tibble::tribble( ~AVISIT, ~ASEQ, ~AVAL, ~MEANVIS, "WEEK 1", 1, 10, 10, @@ -558,13 +477,8 @@ test_that("derive_var_merged_summary Test 17: dataset == dataset_add, no filter" ) }) -<<<<<<< HEAD -## Test 20: dataset != dataset_add, filter ---- -test_that("derive_var_merged_summary Test 20: dataset != dataset_add, filter", { -======= ## Test 18: dataset != dataset_add, filter ---- test_that("derive_var_merged_summary Test 18: dataset != dataset_add, filter", { ->>>>>>> b800ab103ddbf55701d4f6b2ed0080d3c3525f27 expected <- tibble::tribble( ~USUBJID, ~MEANPBL, "1", 13.5, @@ -597,13 +511,8 @@ test_that("derive_var_merged_summary Test 18: dataset != dataset_add, filter", { ) }) -<<<<<<< HEAD -## Test 21: by_vars with rename ---- -test_that("derive_var_merged_summary Test 21: by_vars with rename", { -======= ## Test 19: by_vars with rename ---- test_that("derive_var_merged_summary Test 19: by_vars with rename", { ->>>>>>> b800ab103ddbf55701d4f6b2ed0080d3c3525f27 expected <- tibble::tribble( ~AVISIT, ~ASEQ, ~AVAL, ~MEANVIS, "WEEK 1", 1, 10, 10, diff --git a/tests/testthat/test-derive_param_computed.R b/tests/testthat/test-derive_param_computed.R index 23527b84ad..1d2d6afd73 100644 --- a/tests/testthat/test-derive_param_computed.R +++ b/tests/testthat/test-derive_param_computed.R @@ -62,9 +62,9 @@ test_that("derive_param_computed Test 2: new observations with constant paramete new_obs <- inner_join(input %>% filter(PARAMCD == "HEIGHT") %>% select(USUBJID, AVAL), - input %>% filter(PARAMCD == "WEIGHT") %>% select(USUBJID, VISIT, AVAL), - by = c("USUBJID"), - suffix = c(".HEIGHT", ".WEIGHT") + input %>% filter(PARAMCD == "WEIGHT") %>% select(USUBJID, VISIT, AVAL), + by = c("USUBJID"), + suffix = c(".HEIGHT", ".WEIGHT") ) %>% mutate( AVAL = AVAL.WEIGHT / (AVAL.HEIGHT / 100)^2, @@ -122,7 +122,7 @@ test_that("derive_param_computed Test 3: no new observations if filtered dataset ) ) %>% expect_dfs_equal(input, - keys = c("USUBJID", "PARAMCD", "VISIT") + keys = c("USUBJID", "PARAMCD", "VISIT") ), "The input dataset does not contain any observations fullfiling the filter condition .*" ) @@ -157,7 +157,7 @@ test_that("derive_param_computed Test 4: no new observations are added if a para ) %>% expect_dfs_equal(input, - keys = c("USUBJID", "PARAMCD", "VISIT") + keys = c("USUBJID", "PARAMCD", "VISIT") ), "The input dataset does not contain any observations fullfiling the filter condition .*" ) @@ -284,9 +284,9 @@ test_that("derive_param_computed Test 7: expression in constant_parameters", { new_obs <- inner_join(vs %>% filter(VSTESTCD == "HGHT") %>% select(USUBJID, AVAL = VSSTRESN), - input %>% filter(PARAMCD == "WEIGHT") %>% select(USUBJID, VISIT, AVAL), - by = c("USUBJID"), - suffix = c(".HEIGHT", ".WEIGHT") + input %>% filter(PARAMCD == "WEIGHT") %>% select(USUBJID, VISIT, AVAL), + by = c("USUBJID"), + suffix = c(".HEIGHT", ".WEIGHT") ) %>% mutate( AVAL = AVAL.WEIGHT / (AVAL.HEIGHT / 100)^2, @@ -353,11 +353,7 @@ test_that("derive_param_computed Test 8: no new observations if a constant param ) }) -<<<<<<< HEAD -## Test 9: compute multiple variables ---- -======= ## Test 9: compute multiple variables, keep_nas ---- ->>>>>>> b800ab103ddbf55701d4f6b2ed0080d3c3525f27 test_that("derive_param_computed Test 9: compute multiple variables, keep_nas", { adlb_tbilialk <- tibble::tribble( ~USUBJID, ~PARAMCD, ~AVALC, ~ADTM, ~ADTF, @@ -433,11 +429,7 @@ test_that("derive_param_computed Test 10: deprecation warning if analysis_value select(-AVAL.DIABP, -AVAL.SYSBP) expected_output <- bind_rows(input, new_obs) -<<<<<<< HEAD - expect_warning( -======= expect_error( ->>>>>>> b800ab103ddbf55701d4f6b2ed0080d3c3525f27 derive_param_computed( input, parameters = exprs(SYSBP, DIABP), @@ -449,30 +441,7 @@ test_that("derive_param_computed Test 10: deprecation warning if analysis_value AVALU = "mmHg" ) ), -<<<<<<< HEAD - class = "lifecycle_warning_deprecated" - ) - - expect_dfs_equal( - suppress_warning( - derive_param_computed( - input, - parameters = exprs(SYSBP, DIABP), - by_vars = exprs(USUBJID, VISIT), - analysis_value = (AVAL.SYSBP + 2 * AVAL.DIABP) / 3, - set_values_to = exprs( - PARAMCD = "MAP", - PARAM = "Mean arterial pressure (mmHg)", - AVALU = "mmHg" - ) - ), - regexpr = "is deprecated" - ), - expected_output, - keys = c("USUBJID", "PARAMCD", "VISIT") -======= class = "lifecycle_error_deprecated" ->>>>>>> b800ab103ddbf55701d4f6b2ed0080d3c3525f27 ) }) diff --git a/tests/testthat/test-derive_param_exist_flag.R b/tests/testthat/test-derive_param_exist_flag.R index 902723f768..bf5941bac8 100644 --- a/tests/testthat/test-derive_param_exist_flag.R +++ b/tests/testthat/test-derive_param_exist_flag.R @@ -86,45 +86,3 @@ test_that("derive_param_merged_exist_flag Test 2: error is issued if paramter al fixed = TRUE ) }) -<<<<<<< HEAD - - - -## derive_param_merge_exist_flag Test 4: error for deprecated parameter ---- -test_that("derive_param_exist_flag Test 4: error for deprecated param `dataset_adsl`", { - expect_error( - derive_param_exist_flag( - dataset_adsl = adsl, - dataset_add = adrs, - filter_add = PARAMCD == "OVR", - condition = AVALC == "PD", - false_value = "N", - set_values_to = exprs( - PARAMCD = "PD", - ANL01FL = "Y" - ) - ), - class = "lifecycle_error_deprecated" - ) -}) - -## derive_param_merge_exist_flag Test 5: error for deprecated parameter ---- -test_that("derive_param_exist_flag Test 5: error for deprecated param `subject_keys`", { - expect_error( - derive_param_exist_flag( - dataset_ref = adsl, - dataset_add = adrs, - subject_keys = get_admiral_option("subject_keys"), - filter_add = PARAMCD == "OVR", - condition = AVALC == "PD", - false_value = "N", - set_values_to = exprs( - PARAMCD = "PD", - ANL01FL = "Y" - ) - ), - class = "lifecycle_error_deprecated" - ) -}) -======= ->>>>>>> b800ab103ddbf55701d4f6b2ed0080d3c3525f27 diff --git a/tests/testthat/test-derive_var_dthcaus.R b/tests/testthat/test-derive_var_dthcaus.R index 10ae996265..c9b6997a8d 100644 --- a/tests/testthat/test-derive_var_dthcaus.R +++ b/tests/testthat/test-derive_var_dthcaus.R @@ -414,23 +414,14 @@ test_that("derive_var_dthcaus Test 8: `dataset` is sorted using the `order` para expect_dfs_equal(expected_output, actual_output, keys = "USUBJID") }) -<<<<<<< HEAD -## Test 9: returns a warning when traceability_vars is used ---- -test_that("dthcaus_source Test 9: returns a warning when traceability_vars is used", { -======= ## Test 9: returns a error when traceability_vars is used ---- test_that("derive_var_dthcaus Test 9: returns a error when traceability_vars is used", { ->>>>>>> b800ab103ddbf55701d4f6b2ed0080d3c3525f27 ae <- tibble::tribble( ~STUDYID, ~USUBJID, ~AESEQ, ~AEDECOD, ~AEOUT, ~AEDTHDTC, "TEST01", "PAT01", 12, "SUDDEN DEATH", "FATAL", "2021-04-04" ) -<<<<<<< HEAD - expect_warning( -======= expect_error( ->>>>>>> b800ab103ddbf55701d4f6b2ed0080d3c3525f27 src_ae <- dthcaus_source( dataset_name = "ae", filter = AEOUT == "FATAL", @@ -443,10 +434,6 @@ test_that("derive_var_dthcaus Test 9: returns a error when traceability_vars is DTHSEQ = AESEQ ) ), -<<<<<<< HEAD - class = "lifecycle_warning_deprecated" -======= class = "lifecycle_error_deprecated" ->>>>>>> b800ab103ddbf55701d4f6b2ed0080d3c3525f27 ) }) diff --git a/tests/testthat/test-derive_var_extreme_date.R b/tests/testthat/test-derive_var_extreme_date.R index 3c5c98d908..5529db4301 100644 --- a/tests/testthat/test-derive_var_extreme_date.R +++ b/tests/testthat/test-derive_var_extreme_date.R @@ -211,15 +211,9 @@ test_that("derive_var_extreme_dtm Test 5: error is issued if `--DTC` variable is ) }) -<<<<<<< HEAD -## Test 6: Returns a warning when traceability_vars is assigned ---- -test_that("derive_var_extreme_dtm Test 6: Returns a warning when traceability_vars is assigned", { - expect_warning( -======= ## Test 6: Returns a warning when traceability_vars is assigned ---- test_that("derive_var_extreme_dtm Test 6: Returns a warning when traceability_vars is assigned", { expect_error( ->>>>>>> b800ab103ddbf55701d4f6b2ed0080d3c3525f27 ae_start <- date_source( dataset_name = "ae", date = convert_dtc_to_dtm(AESTDTC), @@ -229,10 +223,6 @@ test_that("derive_var_extreme_dtm Test 6: Returns a warning when traceability_va LALVVAR = "AESTDTC" ) ), -<<<<<<< HEAD - class = "lifecycle_warning_deprecated" -======= class = "lifecycle_error_deprecated" ->>>>>>> b800ab103ddbf55701d4f6b2ed0080d3c3525f27 ) }) diff --git a/tests/testthat/test-derive_var_ontrtfl.R b/tests/testthat/test-derive_var_ontrtfl.R index 91b9e14b73..905790e084 100644 --- a/tests/testthat/test-derive_var_ontrtfl.R +++ b/tests/testthat/test-derive_var_ontrtfl.R @@ -449,11 +449,7 @@ test_that("derive_var_ontrtfl Test 16: expected deprecation messaging", { # noli ) # all flags should be "Y" because span_period flag is TRUE -<<<<<<< HEAD - lifecycle::expect_deprecated( -======= expect_error( ->>>>>>> b800ab103ddbf55701d4f6b2ed0080d3c3525f27 derive_var_ontrtfl( adcm, start_date = ASTDT, @@ -461,20 +457,12 @@ test_that("derive_var_ontrtfl Test 16: expected deprecation messaging", { # noli ref_start_date = TRTSDT, ref_end_date = TRTEDT, span_period = "Y" -<<<<<<< HEAD - ) - ) - - # first obs started before treatment, and it should NOT be flagged - lifecycle::expect_deprecated( -======= ), class = "lifecycle_error_deprecated" ) # first obs started before treatment, and it should NOT be flagged expect_error( ->>>>>>> b800ab103ddbf55701d4f6b2ed0080d3c3525f27 derive_var_ontrtfl( adcm, start_date = ASTDT, @@ -482,11 +470,7 @@ test_that("derive_var_ontrtfl Test 16: expected deprecation messaging", { # noli ref_start_date = TRTSDT, ref_end_date = TRTEDT, span_period = NULL -<<<<<<< HEAD - ) -======= ), class = "lifecycle_error_deprecated" ->>>>>>> b800ab103ddbf55701d4f6b2ed0080d3c3525f27 ) }) diff --git a/tests/testthat/test-derive_var_shift.R b/tests/testthat/test-derive_var_shift.R index bbf720b922..343f51016c 100644 --- a/tests/testthat/test-derive_var_shift.R +++ b/tests/testthat/test-derive_var_shift.R @@ -142,11 +142,7 @@ test_that("derive_var_shift Test 5: Test deprecation warning of na_val argument" "P02", "SODIUM", 147, "Y", "HIGH", "HIGH" ) -<<<<<<< HEAD - expect_warning( -======= expect_error( ->>>>>>> b800ab103ddbf55701d4f6b2ed0080d3c3525f27 derive_var_shift( input, new_var = SHIFT1, @@ -155,10 +151,6 @@ test_that("derive_var_shift Test 5: Test deprecation warning of na_val argument" na_val = "MISSING", sep_val = " - " ), -<<<<<<< HEAD - class = "lifecycle_warning_deprecated" -======= class = "lifecycle_error_deprecated" ->>>>>>> b800ab103ddbf55701d4f6b2ed0080d3c3525f27 ) })