Skip to content

Commit 6ca1ee7

Browse files
committed
Code review feedback
1 parent 3ddadcb commit 6ca1ee7

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

tests/testthat/_snaps/expect-condition.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,21 @@
3636
Condition
3737
Error in `expect_condition()`:
3838
! Can't supply `...` unless `regexp` is set.
39-
* Unusued arguments: `foo`.
39+
* Unused arguments: `foo`.
4040
i `...` is passed to `grepl()` if and only if the `regexp` argument is used.
4141
Code
4242
expect_condition(stop("Hi!"), , , "bar")
4343
Condition
4444
Error in `expect_condition()`:
4545
! Can't supply `...` unless `regexp` is set.
46-
* Unusued arguments: `..1`.
46+
* Unused arguments: `..1`.
4747
i `...` is passed to `grepl()` if and only if the `regexp` argument is used.
4848
Code
49-
expect_condition(stop("Hi!"), , , "bar", foo = "bar")
49+
expect_condition(stop("Hi!"), , , "bar", fixed = TRUE)
5050
Condition
5151
Error in `expect_condition()`:
5252
! Can't supply `...` unless `regexp` is set.
53-
* Unusued arguments: `..1` and `foo`.
53+
* Unused arguments: `..1` and `fixed`.
5454
i `...` is passed to `grepl()` if and only if the `regexp` argument is used.
5555
Code
5656
expect_condition(stop("Hi!"), "x", foo = "bar")
@@ -59,4 +59,11 @@
5959
! Failed to compare condition to `regexp`.
6060
Caused by error in `grepl()`:
6161
! unused argument (foo = "bar")
62+
Code
63+
expect_condition(stop("Hi!"), pattern = "bar", fixed = TRUE)
64+
Condition
65+
Error in `expect_condition()`:
66+
! Can't supply `...` unless `regexp` is set.
67+
* Unused arguments: `pattern` and `fixed`.
68+
i `...` is passed to `grepl()` if and only if the `regexp` argument is used.
6269

tests/testthat/test-expect-condition.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ test_that("unused arguments generate an error", {
246246
expect_condition(stop("Hi!"), , , "bar")
247247
expect_condition(stop("Hi!"), , , "bar", fixed = TRUE)
248248
expect_condition(stop("Hi!"), "x", foo = "bar")
249+
expect_condition(stop("Hi!"), pattern = "bar", fixed = TRUE)
249250
})
250251
})
251252

0 commit comments

Comments
 (0)