Skip to content

Commit

Permalink
Add unit tests to make sure makeSignatures works with DataFrame
Browse files Browse the repository at this point in the history
  • Loading branch information
sdgamboa committed Jun 20, 2024
1 parent 9c74491 commit 09da92f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/testthat/test-makeSignatures-DataFrame.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
library(purrr)
library(S4Vectors)
bp <- map(importBugphyzz(), DataFrame)
sigsNames <- map(bp, ~ makeSignatures(.x, tax_id_type = "Taxon_name")) |>
list_flatten(name_spec = "{inner}")
sigsIDs <- map(bp, ~ makeSignatures(.x, tax_id_type = "NCBI_ID")) |>
list_flatten(name_spec = "{inner}")

test_that("makeSignatures works with IDs", {
expect_true(all(map_lgl(sigsIDs, is.integer)))
})
test_that("makeSignatures works with taxon names", {
expect_true(all(map_lgl(sigsNames, is.character)))
})

0 comments on commit 09da92f

Please sign in to comment.