Skip to content

Commit

Permalink
Increase test coverage for pivotExpressionSet()
Browse files Browse the repository at this point in the history
  • Loading branch information
scheidec committed Mar 29, 2024
1 parent 2370e7b commit 5c01a41
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/testthat/test-pivotExpressionSet.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@ sub_adat <- example_data[1:10, c(1:5, 35:37)]
long <- pivotExpressionSet(adat2eSet(sub_adat))

# Testing ----
test_that("pivotExpressionSet() returns the correct dimensions", {
test_that("pivotExpressionSet() returns the correct class and dimensions", {
expect_s3_class(long, "tbl_df")
expect_equal(dim(long), c(30, 29))
})

test_that("pivotExpressionSet() returns expected metadata columns", {
expect_setequal(rownames(sub_adat), long$array_id)
expect_setequal(getAnalytes(sub_adat), long$feature)
skip("Add increased coverage unit tests for `pivotExpressionSet()`; issue #6")
expect_true(all(names(attributes(sub_adat)$Col.Meta) %in% names(long)))
expect_true(all(getMeta(sub_adat) %in% names(long)))
})

test_that("pivotExpressionSet() preserves analyte values", {
expect_equal(sub_adat[order(row.names(sub_adat)),]$seq.10000.28,
subset(long, feature == "seq.10000.28")$value)
})

0 comments on commit 5c01a41

Please sign in to comment.