inst/unitTests/runit.crud.R

create.Pear <- function(klass, seeds=5, weight=10, type='bartlett')
{
  list(seeds=seeds, weight=weight, type=type)
}

test.create.default <- function()
{
  a <- create(Apple, seeds=10)
  checkTrue(isa(Apple,a))
  checkTrue(a$seeds == 10)
}


test.create.Pear <- function()
{
  b <- create('Pear', seeds=6)
  checkTrue(isa('Pear',b))
  checkTrue(b$seeds == 6)
  checkTrue(b$weight == 10)
  checkTrue(b$type == 'bartlett')
}

test.isa.symbol <- function()
{
  b <- create(Pear, seeds=6)
  checkTrue(isa(Pear,b))
  checkTrue(b$seeds == 6)
  checkTrue(b$weight == 10)
  checkTrue(b$type == 'bartlett')
}

Try the futile.paradigm package in your browser

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

futile.paradigm documentation built on May 2, 2019, 10:37 a.m.