-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
Deprecate zip2() and zip3(). Fixes #128.
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
context("transpose") | ||
|
||
test_that("scalars simplified to vector", { | ||
expect_equal(transpose(list(list(1), list(2)), .simplify = TRUE), list(1:2)) | ||
expect_equal(transpose(list(list(1L), list(2)), .simplify = TRUE), list(1:2)) | ||
}) | ||
|
||
test_that("names preserved", { | ||
expect_equal(transpose(list(list(x = 1), list(x = 2)), .simplify = TRUE), list(x = 1:2)) | ||
}) | ||
|
||
test_that("uses names if present", { | ||
expect_equal(transpose(list(list(x = 1), list(y = 2))), list(x = list(1, NULL))) | ||
}) | ||
|
||
test_that("uses names if present", { | ||
expect_equal( | ||
transpose(list(list(x = 1), list(y = 2)), .fields = c("x", "y")), | ||
list(x = list(1, NULL), y = list(NULL, 2)) | ||
) | ||
}) |