inst/example_tests/simple_tests/test_addition.R

# Project: tinytest2JUnit
# 
# Author: ltuijnder
###############################################################################

dir <- "~/git/tinytest2JUnit/inst/example_tests/simple_tests/"


add <- function(a, b){
  a + b
}

add_one <- function(a){
  a + 1
}

expect_equal(current = add(1,1), target = 2, info = "Math works.")
expect_equal(current = add_one(1), target = 2, info = "Math works with 1")
expect_equal(current = add_one(-1), target = 0)
expect_equal(current = add_one(-1), target = 1)

Try the tinytest2JUnit package in your browser

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

tinytest2JUnit documentation built on June 22, 2024, 9:18 a.m.