1# 2# test-lists.R 3# 4# Copyright (C) 2021 by RStudio, PBC 5# 6# Unless you have received this program directly from RStudio pursuant 7# to the terms of a commercial license agreement with RStudio, then 8# this program is licensed to you under the terms of version 3 of the 9# GNU Affero General Public License. This program is distributed WITHOUT 10# ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT, 11# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the 12# AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details. 13# 14# 15 16context("lists") 17 18test_that("lists converted to scalars", { 19 input <- list(1, 2, 3) 20 expect_equal(.rs.scalarListFromList(input), 21 list(.rs.scalar(1), .rs.scalar(2), .rs.scalar(3))) 22}) 23 24test_that("nested lists converted to scalars", { 25 input <- list(1, 2, list(3, 4)) 26 expect_equal(.rs.scalarListFromList(input), 27 list(.rs.scalar(1), .rs.scalar(2), 28 list(.rs.scalar(3), .rs.scalar(4)))) 29}) 30 31