File: test_namedList.R

package info (click to toggle)
r-cran-bbmisc 1.7-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,156 kB
  • ctags: 13
  • sloc: ansic: 152; sh: 9; makefile: 3
file content (10 lines) | stat: -rw-r--r-- 344 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
context("namedList")

test_that("namedList", {
  expect_equal(namedList(), vector("list", 0))
  expect_equal(namedList("a"), list(a=NULL))
  expect_equal(namedList(c("a", "b")), list(a=NULL, b=NULL))
  expect_equal(namedList(c("a", "b"), 1), list(a=1, b=1))
  f = function(x) x^2
  expect_equal(namedList(c("a", "b"), f(2)), list(a=4, b=4))
})