summaryrefslogtreecommitdiff
path: root/Examples/test-suite/r/unittest.R
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/test-suite/r/unittest.R')
-rw-r--r--Examples/test-suite/r/unittest.R18
1 files changed, 13 insertions, 5 deletions
diff --git a/Examples/test-suite/r/unittest.R b/Examples/test-suite/r/unittest.R
index 81c590a3f..0633c7715 100644
--- a/Examples/test-suite/r/unittest.R
+++ b/Examples/test-suite/r/unittest.R
@@ -1,9 +1,17 @@
unittest <- function (x,y) {
-if (x==y) print("PASS")
-else print("FAIL")
+ 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")
-} \ No newline at end of file
+ if (abs(x-y) < z) {
+ print("PASS")
+ } else {
+ print("FAIL")
+ stop("Test failed")
+ }
+}