Skip to content

Commit

Permalink
restore coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
malecki committed Jan 3, 2019
1 parent 78363b5 commit 9bbe7b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
20 changes: 0 additions & 20 deletions tests/testthat/test-cube-residuals-zed-scores.R
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ test_that("compareDims() dimension validation", {
})

test_that("compareDims() with MRs", {
skip("Revive after specifying what expected MR behavior actually is")
# if the dimension you are trying to compare amongst is an MR you get an
# error (for now)
expect_error(
Expand All @@ -314,25 +313,6 @@ test_that("compareDims() with MRs", {
)
)

# But if the MR is not the dimension being compared amongst, we still
# calculate a score
expected_zScores <- cubify(
-1.34840705967846,
-0.319502930145056,
-2.44219465036739,
-3.14883276639645,
4.11744429667266,
dims = list(
food_groups = c("Vegetables"),
nordics = c("Denmark", "Finland", "Iceland", "Norway", "Sweden")
)
)

expect_equal(
compareRows(cat_by_mr_NSS_alltypes, baseline = "Fruit", x = "Vegetables"),
expected_zScores
)

expect_error(
compareRows(
mr_by_cat,
Expand Down
5 changes: 5 additions & 0 deletions tests/testthat/test-cube-residuals.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,8 @@ test_that("broadcast returns a matrix that mataches", {
fixed = TRUE
)
})

test_that("scalars broadcast too", {
array <- array(c(1,1), dim=c(1,2))
expect_equal(broadcast(1, dim=c(1,2)), array)
})

0 comments on commit 9bbe7b8

Please sign in to comment.