# test_gal2lit
library(here)
library(testthat)
source(here("R", "gal2lit.R"))
context("gal2lit converts correctly")
test_that("gal2lit", {
expect_equal(gal2lit(1), 3.78541)
expect_equal(gal2lit(1/3.78541), 1)
})
context("gal2lit handles input types")
test_that("gal2lit",{
expect_error(gal2lit(NA))
expect_error(gal2lit(NULL))
expect_error(gal2lit("1"))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.