R Under development (unstable) (2023-11-08 r85496 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 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. > ### > ### polyval.R +++ Test suite +++ > ### > > > test.polyval <- function(input, expected) { + output <- do.call(getFromNamespace("polyval", "pracma"), input) + identical(output, expected) + } > > polyval.expected.empty1 <- c() > polyval.expected.empty2 <- c(0, 0) > polyval.expected.vec <- c(3, 1, 1, 3, 7) > polyval.expected.mat <- matrix(c(1, 4, 9, 16), nrow=2, ncol=2) > > test.polyval(list(p=c(1,1), x=c()), polyval.expected.empty1) [1] TRUE > test.polyval(list(p=c(), x=c(1,1)), polyval.expected.empty2) [1] TRUE > test.polyval(list(p=c(1,1,1), x=-2:2), polyval.expected.vec) [1] TRUE > test.polyval(list(p=c(1,0,0), x=matrix(1:4, 2, 2)), polyval.expected.mat) [1] TRUE > > proc.time() user system elapsed 0.18 0.06 0.18