Skip to content

Commit

Permalink
fix error in missing_wells tests (fixes #19)
Browse files Browse the repository at this point in the history
  • Loading branch information
Swarchal committed Apr 4, 2019
1 parent bd5019a commit 9c691c1
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions tests/testthat/test-missing_wells.R
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
context("missing_wells")

# create data with no missing wells
full <- data.frame(val = rnorm(96),
well = num_to_well(1:96))
full <- data.frame(val = rnorm(96), well = num_to_well(1:96))

# create data with missing wells
# missing last 6 wells
missing <- data.frame(val = rnorm(90),
well = num_to_well(1:90))
missing <- data.frame(val = rnorm(90), well = num_to_well(1:90))

out_full <- missing_wells(full, well = 'well')
out_missing <- missing_wells(missing, well = 'well')


test_that("missing_wells errors when expected",{
expect_error(missing_wells(full, well = "well", plate = 1))
expect_error(missing_wells(full, well = TRUE))
expect_error(missing_wells(full, well = full$well))
expect_error(missing_wells(as.list(full), well = full$well),
expect_error(missing_wells(full, well = missing$wel)))
expect_error(missing_wells(as.matrix(full), well = full$well))
expect_error(missing_wells(fill, well = full$not_valid_col))
expect_error(missing_wells(full, well = "well", plate = 1))
expect_error(missing_wells(full, well = TRUE))
expect_error(missing_wells(full, well = full$well))
expect_error(missing_wells(as.list(full), well = full$well))
expect_error(missing_wells(full, well = missing$well))
expect_error(missing_wells(as.matrix(full), well = full$well))
expect_error(missing_wells(fill, well = full$not_valid_col))
})

test_that("missing wells doesn't return anything for a full plate",{
Expand All @@ -30,4 +28,4 @@ test_that("missing wells doesn't return anything for a full plate",{
test_that("missing wells return expected answer",{
expect_equal(length(out_missing), 6L)
expect_equal(out_missing, num_to_well(91:96))
})
})

0 comments on commit 9c691c1

Please sign in to comment.