tests/testthat/test_rule.R

context("Rule")

test_that("Rule empty constructor", {
  rule <- NewRule()
  expect_equal(rule$premises, numeric())
  expect_equal(rule$conclusions, numeric())
})

test_that("Rule constructor", {
  rule <- NewRule(c(0, 1, 2), c(3, 4))
  expect_equal(rule$premises, c(0, 1, 2))
  expect_equal(rule$conclusions, c(3, 4))
})

test_that("Rule properties", {
  rule <- NewRule()
  rule$premises <- c(0, 1, 2)
  rule$conclusions <- c(3, 4)
  expect_equal(rule$premises, c(0, 1, 2))
  expect_equal(rule$conclusions, c(3, 4))
})

Try the FisPro package in your browser

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

FisPro documentation built on March 31, 2023, 7:22 p.m.