Skip to content

Instantly share code, notes, and snippets.

@topepo
Created July 9, 2019 01:21
Show Gist options
  • Save topepo/3b372c7c06a83382683966281f5ad376 to your computer and use it in GitHub Desktop.
Save topepo/3b372c7c06a83382683966281f5ad376 to your computer and use it in GitHub Desktop.
simple Rmd document containing test cases
---
title: "A simple Test Example"
output: html_document
---
```{r setup, include = FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(testthat)
library(sessioninfo)
options(width = 100)
```
Test Date: `r format(Sys.time(), "%a %b %d %H:%M:%S %Y")`
## Introduction
Some information about your application.
Any tests that fail show the error in the sections below. The lack of an error message indicates that the test passed.
## Test 1: The sample mean
This test shows that the mean is calculated appropriately when there are no missing data:
```{r sample-mean-test, error = TRUE}
test_1_inputs <- 1:5
test_1_output <- mean(1:5)
expect_equal(test_1_output, 3)
```
## Session Information
These tests used the following R packages, their version, and source:
```{r versions, echo = FALSE}
sessioninfo::session_info()
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment