Skip to content

Commit

Permalink
use expect_in instead of expect_contains
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobvjk committed Sep 2, 2024
1 parent a9090df commit 3a65a84
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tests/testthat/test-run_calculate_match_success_rate.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ test_that("combine_raw_and_matched_loan_books removes group_id from id_loan wher

testthat::expect_equal(test_raw$id_loan, unique(test_lbk_match_success$id_loan))

testthat::expect_contains(test_raw$id_loan, gsub("_test", "", test_matched_prio$id_loan))
testthat::expect_in(
gsub("_test", "", test_matched_prio$id_loan),
test_raw$id_loan
)
})

test_that("combine_raw_and_matched_loan_books removes sector_abcd from id_loan where needed", {
Expand All @@ -93,7 +96,13 @@ test_that("combine_raw_and_matched_loan_books removes sector_abcd from id_loan w
matched_prioritized = test_matched_prio
)

testthat::expect_equal(test_raw$id_loan, unique(test_lbk_match_success$id_loan))
testthat::expect_equal(
test_raw$id_loan,
unique(test_lbk_match_success$id_loan)
)

testthat::expect_contains(unique(r2dii.data::sector_classifications$sector), gsub(paste0(test_raw$id_loan, "_", collapse = "|"), "", test_matched_prio$id_loan))
testthat::expect_in(
gsub(paste0(test_raw$id_loan, "_", collapse = "|"), "", test_matched_prio$id_loan),
unique(r2dii.data::sector_classifications$sector)
)
})

0 comments on commit 3a65a84

Please sign in to comment.