Skip to content

Commit

Permalink
lintr
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Mar 3, 2024
1 parent 2876044 commit f672e67
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/testthat/test-data_reorder.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
test_that("data_reorder works as expected", {
expect_equal(
names(data_reorder(iris, c("Species", "Sepal.Length"))),
expect_named(
data_reorder(iris, c("Species", "Sepal.Length")),
c("Species", "Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width")
)

expect_warning(expect_equal(
names(data_reorder(iris, c("Species", "dupa"))),
expect_warning(expect_named(
data_reorder(iris, c("Species", "dupa")),
c("Species", "Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width")
))
})
Expand All @@ -24,5 +24,6 @@ test_that("data_reorder preserves attributes", {
a2 <- attributes(out2)

# attributes may not be in the same order
expect_true(all(names(a1) %in% names(a2)) && length(a1) == length(a2))
expect_true(all(names(a1) %in% names(a2)))
expect_length(a1, length(a2))
})

0 comments on commit f672e67

Please sign in to comment.