/trunk/Examples/test-suite/r/unittest.R
# · R · 17 lines · 16 code · 1 blank · 0 comment · 4 complexity · 6ef588ea07bd9118136d3fbabe80d4fd MD5 · raw file
- unittest <- function (x,y) {
- if (x==y) {
- print("PASS")
- } else {
- print("FAIL")
- stop("Test failed")
- }
- }
- unittesttol <- function(x,y,z) {
- if (abs(x-y) < z) {
- print("PASS")
- } else {
- print("FAIL")
- stop("Test failed")
- }
- }