Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
zenalapp committed Sep 8, 2023
1 parent 89d4d28 commit 75399c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 0 additions & 2 deletions tests/testthat/_snaps/match_static_thresh.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

Code
match_static_thresh(bistro_output$lrs, 10)
Message <rlang_message>
Joining with `by = join_by(bloodmeal_id, locus_count, est_noc)`
Output
# A tibble: 1 x 6
bloodmeal_id locus_count est_noc match human_id log10_lr
Expand Down
8 changes: 8 additions & 0 deletions tests/testthat/test-match_static_thresh.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,16 @@ test_that("match_static_thresh works", {
return_lrs = TRUE
) |>
suppressMessages()

expect_snapshot(match_static_thresh(bistro_output$lrs, 10))

expect_true(nrow(dplyr::bind_rows(
bistro_output$lrs,
bistro_output$lrs |>
dplyr::mutate(human_id = "P2", log10_lr = -10)
) |>
match_static_thresh(10)) == 1)

expect_true(bistro_output$lrs |>
dplyr::mutate(log10_lr = Inf) |>
match_static_thresh(10) |>
Expand Down

0 comments on commit 75399c2

Please sign in to comment.