File: test-dots.R

package info (click to toggle)
r-cran-lazyeval 0.2.0-1~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 1,276 kB
  • sloc: ansic: 268; sh: 9; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 472 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

context("lazy_dots")

test_that("lazy_dots works with no args", {
  l1 <- lazy_dots()
  l2 <- lazy_dots(.follow_symbols = TRUE)

  expect_equal(l1, structure(list(), class = "lazy_dots"))
  expect_equal(l2, structure(list(), class = "lazy_dots"))

})


test_that(".ignore_empty drops empty arguments", {
  l1 <- lazy_dots(, 1,)
  l2 <- lazy_dots(, 1, , .ignore_empty = TRUE)

  expect_equal(length(l1), 3)
  expect_equal(length(l2), 1)
  expect_equal(l2[[1]]$expr, 1)
})