Skip to content

Commit

Permalink
Add unit tests to increase coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
aadler committed Aug 7, 2023
1 parent 1781165 commit c4bc88f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions inst/tinytest/test_horner.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright Avraham Adler (c) 2023
# SPDX-License-Identifier: MPL-2.0+

tol <- 1e-7
x <- 1:3
a <- c(1, 1e-6, 1e-12)
expect_equal(minimaxApprox:::horner(x, a),
minimaxApprox:::compensatedHorner(x, a),
tolerance = tol)

expect_error(minimaxApprox:::hornerSum(x, a, c(a, 1)),
"Error polynomials must be of same length.")

0 comments on commit c4bc88f

Please sign in to comment.