From f672e679e6efddf9726ec6344562cbd37dbddef4 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 3 Mar 2024 18:00:20 +0100 Subject: [PATCH] lintr --- tests/testthat/test-data_reorder.R | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/testthat/test-data_reorder.R b/tests/testthat/test-data_reorder.R index 34a8f5420..463f36040 100644 --- a/tests/testthat/test-data_reorder.R +++ b/tests/testthat/test-data_reorder.R @@ -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") )) }) @@ -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)) })