ok( 1==1, "1 equals 1")
# ok - 1 equals 1
ok( 1==1 )
# ok - 1 == 1
ok( 1==2, "1 equals 2")
# not ok - 1 equals 2
# # Test returned non-TRUE value:
# # [1] FALSE
ok( all.equal(c(1,2),c(1,2)), "compare vectors" )
# ok - compare vectors
ok( stop("oops"), "something with a coding error")
# not ok - something with a coding error
# # Test resulted in error: oops
# # -> doTryCatch
# # -> return(expr)
# # -> name
# # -> parentenv
# # -> handler
ok( c("Some diagnostic", "messages"), "A failure with diagnostic messages" )
# not ok - A failure with diagnostic messages
# # Test returned non-TRUE value:
# # Some diagnostic
# # messages
Run the code above in your browser using DataLab