tests/testthat/test_method_gcd.R

context("method GCD")

test_that("GCD", {
  init_data()

  expect_equal(GCD(pm_first), p(1))
  expect_equal(GCD(parse.polyMatrix("1 + 3x,      2, 2 + 3x",
                                    "     3, 1 + 3x, 1 + 4x")),
               p(1))
  expect_equal(GCD(parse.polyMatrix("  1 + 3x, 1 + 6x + 9x^2",
                                    "1 - 9x^2,        1 + 3x")),
               p(1, 3))
})

Try the polyMatrix package in your browser

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

polyMatrix documentation built on July 18, 2021, 5:06 p.m.