Skip to content

Commit

Permalink
Add example code and test for R CMD check
Browse files Browse the repository at this point in the history
  • Loading branch information
cforgaci committed May 2, 2024
1 parent 977ece9 commit 8ac3146
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
18 changes: 18 additions & 0 deletions R/hello.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Hello, world!
#
# This is an example function named 'hello'
# which prints 'Hello, world!'.
#
# You can learn more about package authoring with RStudio at:
#
# https://r-pkgs.org
#
# Some useful keyboard shortcuts for package authoring:
#
# Install Package: 'Cmd + Shift + B'
# Check Package: 'Cmd + Shift + E'
# Test Package: 'Cmd + Shift + T'

hello <- function() {
print("Hello, world!")
}
12 changes: 12 additions & 0 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file is part of the standard setup for testthat.
# It is recommended that you do not modify it.
#
# Where should you do additional test configuration?
# Learn more about the roles of various files in:
# * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
# * https://testthat.r-lib.org/articles/special-files.html

library(testthat)
library(CRiSp)

test_check("CRiSp")
3 changes: 3 additions & 0 deletions tests/testthat/test-hello.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test_that("multiplication works", {
expect_equal(2 * 2, 4)
})

0 comments on commit 8ac3146

Please sign in to comment.