Add some warnings in README
[pkgdev.git] / R / RunitTestsMethods.R
CommitLineData
156f8ca6
BA
1# Functions to assert that conditions are true or false in R unit tests
2
3RunitTestsMethods = '
4# Functions to assert that a condition is true or false [to be extended]
5assertTrue = function(condition, message, context="") {
6 if (!condition) {
7 cat("Failure: ", message, sep=\'\')
8 if (context != "") cat(" [",context,"]")
9 cat("\\n")
10 }
11}
12
13assertFalse = function(condition, message, context="") {
14 assertTrue(!condition, message, context)
15}
16'