Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mwmclean committed Sep 5, 2017
1 parent 3b4e0cf commit ff81ec8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/testthat/test-tidyrawdata.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ test_that("TidyRawData: fails when weights or subset wrong length",
expect_error(TidyRawData(x, subset = wgt > 5))
})

wgt = c(NA, 0, rep(1, 100), rep(NA, 225))

test_that("TidyRawData: missing values in weights cause data to be filtered",
{
wgt = c(NA, 0, rep(1, 100), rep(NA, 225))
out <- suppressWarnings(TidyRawData(x, weights = wgt))
expect_equal(nrow(out), 100)
expect_equivalent(out, x[!is.na(wgt) & wgt, ]) # expect_equivalent(out, x[3:102, ])
Expand Down

0 comments on commit ff81ec8

Please sign in to comment.