Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up| library(testthat) | |
| # each call to test_that() produces one test | |
| # each test represents one point value | |
| # you can have multiple tests for each question | |
| test_that("first (visible)", { | |
| expect_equal( sum(myVector), 6) | |
| }) | |
| test_that("second (invisible)", { | |
| expect_true(is.character(myString)) | |
| expect_true(nchar(myString) > 2) | |
| }) | |
| test_that("third", { | |
| expect_equal(nrow(myDataFrame), 2) | |
| expect_equal(myDataFrame[2,3], 700.01, tolerance=1e-3) | |
| }) |