swig/Examples/test-suite/r/unittest.R
2022-10-17 20:14:45 +01:00

26 lines
403 B
R

unittest <- function (x,y) {
if (all(x==y)) {
print("PASS")
} else {
print("FAIL")
stop("Test failed")
}
}
unittesttol <- function(x,y,z) {
if (all(abs(x-y) < z)) {
print("PASS")
} else {
print("FAIL")
stop("Test failed")
}
}
unittest_sequence <- function (x,y) {
if (setequal(x, y)) {
print("PASS")
} else {
print("FAIL")
stop("Test failed")
}
}