Skip to content

Commit

Permalink
Add test for when number of rows in 'mod' does not match number of co…
Browse files Browse the repository at this point in the history
…lumns in 'rse_tx'
  • Loading branch information
HediaTnani committed Jan 10, 2024
1 parent 25e2395 commit 7e7f2cd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/testthat/test-k_qsvs.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ test_that("output is an numeric", {
expect_equal(class(k_res), "numeric")
})

# Test when number of rows in 'mod' does not match number of columns in 'rse_tx'
test_that("Number of rows in 'mod' does not match number of columns in 'rse_tx'", {
mod_not_matching <- mod
mod_not_matching <- mod_not_matching[-1, ]
expect_error(k_qsvs(covComb_tx_deg, mod_not_matching, "tpm"),
"The number of rows in 'mod' does not match the number of input 'rse_tx' columns.")
})

test_that("non-full rank data throws error", {
set.seed(20230621)
Expand Down

0 comments on commit 7e7f2cd

Please sign in to comment.