Skip to content

Commit

Permalink
Adds test for rstudio#95
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettgman committed Mar 16, 2020
1 parent 3baa4d9 commit 6671cea
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/testthat/test_detect_mistakes.R
Original file line number Diff line number Diff line change
Expand Up @@ -711,3 +711,16 @@ test_that("detect_mistakes does not throw error for multiple matches of argument

})

test_that("detect_mistakes does not throw error for multiple matches of formal", {

a <- function(x, yab = 1, ...) x
user <- quote(a(1, y = 2, ya = 3))
solution <- quote(a(1))
expect_equal(
detect_mistakes(user, solution)
,
surplus_argument(this_call = quote(a()), this = quote(2), this_name = "y")
)

})

0 comments on commit 6671cea

Please sign in to comment.