tests/testthat/test-odds.R

library(odds)

context("Conversions")

test_that("converting fractional -> decimal", {
  expect_equal(to.decimal("1/2"), 1.5)
})

test_that("converting decimal -> fractional", {
  expect_equal(to.fractional(1.5), "1/2")
})
grahamplace/odds documentation built on May 17, 2019, 8:19 a.m.