PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/test-suite/r/unittest.R

#
R | 17 lines | 16 code | 1 blank | 0 comment | 4 complexity | 6ef588ea07bd9118136d3fbabe80d4fd MD5 | raw file
 1unittest <- function (x,y) {
 2  if (x==y) {
 3    print("PASS") 
 4  } else {
 5    print("FAIL") 
 6    stop("Test failed")
 7  }
 8}
 9
10unittesttol <- function(x,y,z) {
11  if (abs(x-y) < z) {
12    print("PASS")
13  } else {
14    print("FAIL")
15    stop("Test failed")
16  }
17}