-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #18
- Loading branch information
Showing
5 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# Generated by roxygen2: do not edit by hand | ||
|
||
export(integer_addition) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#' @name integer_addition | ||
#' @export | ||
#' @title adds two integers | ||
#' @description Adding two numbers | ||
#' @param a first integer | ||
#' @param b second integer | ||
|
||
integer_addition <- function( a, b ) | ||
{ | ||
c <- a + b | ||
return( c ) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#Modeled after the R6 testing structure: https://github.com/wch/R6/blob/master/tests/testthat.R | ||
library(testthat) | ||
library(rpackageskeleton) | ||
|
||
testthat::test_check("rpackageskeleton") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
library(testthat) | ||
context("Integer addition") | ||
|
||
test_that("smoke-test", { | ||
returned <- integer_addition(3,5) | ||
expect_true(!is.null(returned)) | ||
}) | ||
|
||
test_that("vector-test", { | ||
a <- 5:10 | ||
b <- -16:-11 | ||
expected <- -1L | ||
returned <- integer_addition(3:6) | ||
expect_equal(returned, expected) | ||
}) |