Added unit tests for fix()

This commit is contained in:
Waldir Leoncio 2020-07-14 14:10:12 +02:00
parent 107d07bcf2
commit 9954f12f6f

View file

@ -188,4 +188,10 @@ test_that("squeeze works as expected", {
A <- array(0, dim = c(1, 1, 3))
A[, , 1:3] <- 1:3
expect_equal(squeeze(A), matrix(1:3, 3))
})
test_that("fix works as expected", {
X <- matrix(c(-1.9, -3.4, 1.6, 2.5, -4.5, 4.5), 3, byrow=TRUE)
Y <- matrix(c(-1, -3, 1, 2, -4, 4), 3, byrow=TRUE)
expect_identical(fix(X), Y)
})