From b3877f5047379936e2f4c24be2448879a538eb50 Mon Sep 17 00:00:00 2001 From: Michael Malecki Date: Thu, 3 Jan 2019 14:59:56 -0500 Subject: [PATCH] restore coverage --- .../testthat/test-cube-residuals-zed-scores.R | 20 ------------------- tests/testthat/test-cube-residuals.R | 5 +++++ 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/tests/testthat/test-cube-residuals-zed-scores.R b/tests/testthat/test-cube-residuals-zed-scores.R index df5803319..2c449be80 100644 --- a/tests/testthat/test-cube-residuals-zed-scores.R +++ b/tests/testthat/test-cube-residuals-zed-scores.R @@ -307,7 +307,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( @@ -322,25 +321,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, diff --git a/tests/testthat/test-cube-residuals.R b/tests/testthat/test-cube-residuals.R index 4406b26c1..392464436 100644 --- a/tests/testthat/test-cube-residuals.R +++ b/tests/testthat/test-cube-residuals.R @@ -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) +})