R Under development (unstable) (2024-02-17 r85935 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > # This file is for checking expectWarnings() and expectStop() > > library("splus2R") > > testFile <- "warnings.t" > do.test(testFile) ------- Test file: warnings.t --------- NULL $`Test result` [1] "abc" NULL $`Unexpected warnings` [1] "This is a second warning" NULL $`Warnings expected but not found` [1] "When in the course of human events" > do.test(testFile, local=TRUE) ------- Test file: warnings.t --------- NULL $`Test result` [1] "abc" NULL $`Unexpected warnings` [1] "This is a second warning" NULL $`Warnings expected but not found` [1] "When in the course of human events" > > testFile <- "stops.t" > do.test(testFile) ------- Test file: stops.t --------- NULL [1] "Error message differs from expected message" [2] "Expected:" [3] "sugar and spice" [4] "Actual:" [5] "Error in f(\"abc\") : function stopped\n" NULL [1] "Failed to stop, instead returned an object of class logical" NULL [1] "Failed to stop, instead returned an object of class character" > do.test(testFile, verbose=TRUE) ------- Test file: stops.t --------- NULL [1] TRUE NULL [1] TRUE NULL [1] TRUE NULL [1] TRUE NULL [1] "Error message differs from expected message" [2] "Expected:" [3] "sugar and spice" [4] "Actual:" [5] "Error in f(\"abc\") : function stopped\n" NULL [1] "Failed to stop, instead returned an object of class logical" NULL [1] "Failed to stop, instead returned an object of class character" NULL [1] TRUE > > proc.time() user system elapsed 0.29 0.04 0.32