Skip to content

Commit

Permalink
test: add tests
Browse files Browse the repository at this point in the history
Signed-off-by: German Beldorati Stark <[email protected]>
  • Loading branch information
gerbeldo committed Oct 31, 2023
1 parent 8b2abb0 commit b07dd6a
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions pipeline-runner/tests/testthat/test-qc-7-embed_and_cluster.R
Original file line number Diff line number Diff line change
Expand Up @@ -609,4 +609,25 @@ test_that("make_cl_metadata_table works with duplicate barcodes", {
}
})

test_that("add_duplicate_barcode_column handles empty input correctly", {
empty_cl_metadata <- data.frame(barcode = character(0))
expect_equal(nrow(add_duplicate_barcode_column(empty_cl_metadata)), 0)
})

test_that("add_duplicate_barcode_column handles unique barcodes correctly", {
unique_cl_metadata <- data.frame(barcode = c("BC01", "BC02", "BC03"))
unique_result <- add_duplicate_barcode_column(unique_cl_metadata)
expect_equal(unique_result$duplicate_barcode, NULL)
})

test_that("add_duplicate_barcode_column handles duplicate barcodes correctly", {
dup_cl_metadata <- data.frame(barcode = c("BC01", "BC01", "BC02"))
dup_result <- add_duplicate_barcode_column(dup_cl_metadata)
expect_equal(dup_result$duplicate_barcode, c("yes", "yes", "no"))
})

test_that("add_duplicate_barcode_column handles a mix of unique and duplicate barcodes correctly", {
mixed_cl_metadata <- data.frame(barcode = c("BC01", "BC02", "BC02", "BC03"))
mixed_result <- add_duplicate_barcode_column(mixed_cl_metadata)
expect_equal(mixed_result$duplicate_barcode, c("no", "yes", "yes", "no"))
})

0 comments on commit b07dd6a

Please sign in to comment.