Skip to content

Commit

Permalink
Fix code style in expect_snapshot()
Browse files Browse the repository at this point in the history
  • Loading branch information
KimLopezGuell committed Aug 15, 2024
1 parent a7c8630 commit d6e6f03
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
4 changes: 1 addition & 3 deletions tests/testthat/test-conv.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ test_that("encoding conversion works", {
})

test_that("check encoding argument", {
expect_snapshot(error = TRUE,
str_conv("A", c("ISO-8859-1", "ISO-8859-2"))
)
expect_snapshot(str_conv("A", c("ISO-8859-1", "ISO-8859-2")), error = TRUE)
})
4 changes: 1 addition & 3 deletions tests/testthat/test-equal.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ test_that("vectorised using TRR", {
expect_equal(str_equal("a", character()), logical())
expect_equal(str_equal("a", "b"), FALSE)
expect_equal(str_equal("a", c("a", "b")), c(TRUE, FALSE))
expect_snapshot(error = TRUE,
str_equal(letters[1:3], c("a", "b"))
)
expect_snapshot(str_equal(letters[1:3], c("a", "b")), error = TRUE)
})

test_that("can ignore case", {
Expand Down
4 changes: 1 addition & 3 deletions tests/testthat/test-flatten.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ test_that("equivalent to paste with collapse", {
})

test_that("collapse must be single string", {
expect_snapshot(error = TRUE,
str_flatten("A", c("a", "b"))
)
expect_snapshot(str_flatten("A", c("a", "b")), error = TRUE)
})

test_that("last optionally used instead of final separator", {
Expand Down

0 comments on commit d6e6f03

Please sign in to comment.