Corrected the testing in unittest so that all elements of

a vector result are checked. Previously it was just the first
element.
This commit is contained in:
Richard Beare 2016-03-15 12:14:20 +11:00
commit 5c2cd32795

View file

@ -1,5 +1,5 @@
unittest <- function (x,y) {
if (x==y) {
if (all(x==y)) {
print("PASS")
} else {
print("FAIL")
@ -8,7 +8,7 @@ unittest <- function (x,y) {
}
unittesttol <- function(x,y,z) {
if (abs(x-y) < z) {
if (all(abs(x-y) < z)) {
print("PASS")
} else {
print("FAIL")