astamm / nloptr

nloptr provides an R interface to NLopt, a free/open-source library for nonlinear optimization providing a common interface to a number of different optimization routines which can handle nonlinear constraints and lower and upper bounds for the controls.
https://astamm.github.io/nloptr/
Other
103 stars 36 forks source link

Three test files assume `options(digits=7)` but do not set it #140

Closed eddelbuettel closed 10 months ago

eddelbuettel commented 10 months ago

My machine happens to have options(digits=6). Three test files fails unless I add options(digits=7):

inst/tinytest/test-check.derivatives.R
inst/tinytest/test-nloptr.R
inst/tinytest/test-print.nloptr.R

Comparing against a fixed string may also be dicey in other (non-English) locales.

aadler commented 10 months ago

Comparing against a fixed string may also be dicey in other (non-English) locales.

Agreed. For the pure numbers ones I think we're OK. Otherwise, we can go back and try to extract the portions of the strings which should be invariant under locales.

aadler commented 10 months ago

@astamm @eddelbuettel Just for completeness, we should add the change to the NEWS.

aadler commented 10 months ago

Unless you think it covered by the mention of "conversion to tinytest". That would work too.