-
Notifications
You must be signed in to change notification settings - Fork 195
Closed
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behavior
Description
> expect_lint("cat('hello')", "double-quotes", lintr::single_quotes_linter)
As expected
> expect_lint("cat('hello')", "double-quotes (with parentheses)", lintr::single_quotes_linter)
Error: Don't know how to convert 'data.frame' to expectation.
The first expect_lint() call behaves as expected. The second does not; it errors instead of reporting that the "message" does not match.
The problem in the second case is the presence of parentheses in the regular expression, which are interpreted as captures. Captures have no reasons to be used in this context and they cause trouble at expect_lint.R line 60 because re_matches then returns a data.frame instead of a logical. Potential solutions would be to somehow escape captures in "value" just before the call to re_matches, or to force re_matches to return a single logical.
Best,
Florent
Metadata
Metadata
Assignees
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behavior