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. > ### > ### Poly.R +++ Test suite +++ > ### > > > test.Poly <- function(input, expected) { + output <- do.call(getFromNamespace("Poly", "pracma"), input) + identical(output, expected) + } > > Poly.expected.empty <- 1 > Poly.expected.1 <- c(1, -6, 11, -6) > #Poly.expected.2 <- error > Poly.expected.3 <- c(1, 0, 0, 0, -1) > Poly.expected.4 <- c(1, -10, 35, -50, 24) > Poly.expected.5 <- c(1, -4, 6, -4, 1) > Poly.expected.6 <- c(1, -5) > > test.Poly(list(x=c()), Poly.expected.empty) [1] TRUE > test.Poly(list(x=c(1,2,3)), Poly.expected.1) [1] TRUE > #test.Poly(list(x=matrix(1:6, 2, 3)), Poly.expected.2) > test.Poly(list(x=c(1,-1,1i,-1i)), Poly.expected.3) [1] TRUE > test.Poly(list(x=c(1,2,3,4)), Poly.expected.4) [1] TRUE > test.Poly(list(x=diag(4)), Poly.expected.5) [1] TRUE > test.Poly(list(x=5), Poly.expected.6) [1] TRUE > > proc.time() user system elapsed 0.15 0.03 0.17