Skip to content

Commit

Permalink
Add test for error.
Browse files Browse the repository at this point in the history
  • Loading branch information
gbasulto committed May 13, 2019
1 parent 1c607cd commit de8a170
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/testthat/test-fourierin_1d.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,22 @@ context("univariate")
test_that("fourierin works for 1d", {
## Function to be used in the integrand
myfnc <- function(t) exp(-t^2/2)

## Compute integral
out <- fourierin(f = myfnc, lower_int = -5, upper_int = 5,
lower_eval= -3, upper_eval = 3, const_adj = -1,
freq_adj = -1, resolution = 64)
expect_is(out, "list")
})


test_that("error if evaluation grid nor evaluation bounds are provided", {
## Function to be used in the integrand
myfnc <- function(t) exp(-t^2/2)

## Compute integral
expect_error(
fourierin(f = myfnc, lower_int = -5, upper_int = 5,
const_adj = -1,
freq_adj = -1, resolution = 64))
})

0 comments on commit de8a170

Please sign in to comment.