summaryrefslogtreecommitdiff
path: root/Examples/test-suite/r/catches_strings_runme.R
blob: 2eb4f3c8301b4a82253efafb09fe7e14d249e8a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
clargs <- commandArgs(trailing=TRUE)
source(file.path(clargs[1], "unittest.R"))

dyn.load(paste("catches_strings", .Platform$dynlib.ext, sep=""))
source("catches_strings.R")
cacheMetaData(1)

exception_thrown = FALSE
tryCatch({
    StringsThrower_charstring()
}, error = function(e) {
    exception_thrown <<- grepl(e$message, "charstring message", fixed=TRUE)
}
)
unittest(exception_thrown, TRUE)