Re: [R-pkg-devel] Testing for a Specific R Error

2017-12-02 Thread Duncan Murdoch
On 02/12/2017 2:19 PM, Bill Denney wrote: On Dec 2, 2017, at 09:43, Duncan Murdoch wrote: I don't think there's anything better than Bill's solution, though I imagine it is possible to ask for translation of the message. For example, sqrt(-1) currently gives a warning with English message

Re: [R-pkg-devel] Testing for a Specific R Error

2017-12-02 Thread Bill Denney
> On Dec 2, 2017, at 09:43, Duncan Murdoch wrote: > > I don't think there's anything better than Bill's solution, though I imagine > it is possible to ask for translation of the message. For example, sqrt(-1) > currently gives a warning with English message "NaNs produced". Another idea just

Re: [R-pkg-devel] Testing for a Specific R Error

2017-12-02 Thread Duncan Murdoch
On 02/12/2017 9:23 AM, Dirk Eddelbuettel wrote: On 2 December 2017 at 08:38, Bill Denney wrote: | Hi, | | I got a message last night that some of the tests in the PKNCA package do not follow best practices. ("Do not test the exact format of R messages (from R itself or from other packages): T

Re: [R-pkg-devel] Testing for a Specific R Error

2017-12-02 Thread Henrik Bengtsson
For the translation part, you can test the received error message against the translated message. You can get the translated version from the original one using gettext(""). This should be agile to user's language settings but, of course, not to changes that the developer does to the the error mes

Re: [R-pkg-devel] Testing for a Specific R Error

2017-12-02 Thread Dirk Eddelbuettel
On 2 December 2017 at 08:38, Bill Denney wrote: | Hi, | | I got a message last night that some of the tests in the PKNCA package do not follow best practices. ("Do not test the exact format of R messages (from R itself or from other packages): They change, and they can be translated.") Speci

[R-pkg-devel] Testing for a Specific R Error

2017-12-02 Thread Bill Denney
Hi, I got a message last night that some of the tests in the PKNCA package do not follow best practices. ("Do not test the exact format of R messages (from R itself or from other packages): They change, and they can be translated.") Specifically, I test to ensure that an error is generated wh