-
Notifications
You must be signed in to change notification settings - Fork 997
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes for
test.data.table()
in foreign mode (#6808)
* test.data.table(): don't test non-English output This is already done for warnings and errors. Unfortunately, some tests do check output and conditions by hand, so test.data.table() still requires LANGUAGE=en for now. * Use test(output=) instead of capture.output() A comment near 1832.2 said that output= was inapplicable due to square bracket matching. The actual source of the problem was the caret only matching start of string instead of start of line. * Use output= for some all.equal tests While not all all.equal() output is translated, those cases that are result in test failures when comparing the output in test() calls. Use output= so that the test would be skipped in 'foreign' mode. * Don't count foreign warnings when skipping some We already only count warnings in foreign mode, don't match their text contents. With ignore.warning set, we lack a way to figure out when the translated warning should be skipped, so don't count them at all. * Also skip notOutput= tests in foreign mode The length(output) || length(notOutput) branch makes length(output) at least 1. Later, 'y' value check is skipped if length(output) is nonzero. Instead of skipping this branch altogether in foreign mode, make sure that it's taken so that the 'y' value check is later skipped when foreign mode is on. * test(options=...) applies them for a shorter time Instead of applying passed options= for the rest of the call frame, undo them immediately after evaluating the call. This prevents testing for options(datatable.alloccol=...) from breaking the internal data.table usage and allows rewriting the tests using the options=... and error=... arguments, which skip tests as appropriate in foreign mode. * remove regex mark-up for clarity * rm regex again * ws style * check !foreign before attempting string_match() * ditto * Elaborate on the use of options() --------- Co-authored-by: Michael Chirico <chiricom@google.com>
- Loading branch information
1 parent
5623b7a
commit c29e313
Showing
2 changed files
with
87 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters