inst/unittests/runit-utilities.r

##
## runit-utilities.r - check internal utility functions
##

test.inbounds <- function() {
  x <- c(0, 1, 2)
  checkEquals(emoa:::inbounds(x, 0, 1), c(0, 1, 1))
  checkEquals(emoa:::inbounds(x, 1, 2), c(1, 1, 2))
  checkEquals(emoa:::inbounds(x, 1, 1), c(1, 1, 1))

  checkEquals(emoa:::inbounds(x, c(0, 0, 1), c(1, 1, 2)), c(0, 1, 2))
  checkEquals(emoa:::inbounds(x, c(1, 0, 1), c(1, 1, 2)), c(1, 1, 2))
  checkEquals(emoa:::inbounds(x, c(0, 0, 1), c(1, 1, 1)), c(0, 1, 1))
}

Try the emoa package in your browser

Any scripts or data that you put into this service are public.

emoa documentation built on March 13, 2020, 2:59 a.m.