tests/testthat/test-mpolylist.R

context("mpolyList()")

test_that("basic", {
  
  expect_equal(
    mpolyList(mp("x"), mp("x^2"), mp("x^3 t")),
    structure(
      list(
        structure(list(c(x = 1, coef = 1)), class = "mpoly"), 
        structure(list(c(x = 2, coef = 1)), class = "mpoly"), 
        structure(list(c(x = 3, t = 1, coef = 1)), class = "mpoly")
      ), 
      class = "mpolyList"
    )
  )
  
  expect_error(
    mpolyList(
      mp("x"),
      "y"
    ),
    "Each argument must be of class mpoly.",
    fixed = TRUE
  )
  
  
})

Try the mpoly package in your browser

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

mpoly documentation built on March 26, 2020, 7:33 p.m.