Skip to content

Commit

Permalink
add tests for previous
Browse files Browse the repository at this point in the history
  • Loading branch information
bquast committed Jun 24, 2015
1 parent 9dc195c commit 99230ba
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/testthat/test_fatdiag.R
Expand Up @@ -53,6 +53,7 @@ test_that("output values match", {
expect_equal( sum(f8), 666)
})


# define context
context("fatdiag: extract")

Expand All @@ -77,6 +78,7 @@ test_that("output values match", {
expect_equal( sum(e4), 6)
})


# define context
context("fatdiag: errors")

Expand All @@ -91,13 +93,13 @@ context("fatdiag<-: scalar")

# create objects
fatdiag(f1, steps = 3 ) <- 2
#fatdiag(f2, size = 4 ) <- 2
fatdiag(f2, size = 4 ) <- 2
fatdiag(f3, size = c(3,4) ) <- 2

# test output values
test_that("output values match", {
expect_equal( sum(f1), 96)
#expect_equal( sum(f6), 96)
expect_equal( sum(f6), 1176)
expect_equal( sum(f3), 72)
#expect_equal( sum(f8), 36)
})
Expand All @@ -109,16 +111,17 @@ context("fatdiag<-: vector")
# create objects
fatdiag(f5, steps = 3 ) <- 1:48
fatdiag(f6, size = c(4,4) ) <- 1:48

fatdiag(f7, size = c(3,4) ) <- 1:36

# test output values
test_that("output values match", {
expect_equal( sum(f5), 1176)
expect_equal( sum(f6), 1176)
#expect_equal( sum(f7), 36)
expect_equal( sum(f7), 666)
#expect_equal( sum(f8), 36)
})


# define context
context("fatdiag: errors")

Expand Down

0 comments on commit 99230ba

Please sign in to comment.