inst/tinytest/test_utils.R

# Tests for collapse_data() and stop_unless_installed()

# --- collapse_data ---

expect_equal(cpp4r:::collapse_data(mtcars, ""), "")
expect_equal(cpp4r:::collapse_data(mtcars[FALSE, ], "{hp}"), "")
expect_equal(cpp4r:::collapse_data(mtcars[1, ], "{hp}"), "110")
expect_equal(cpp4r:::collapse_data(mtcars[1:2, ], "{hp}"), "110, 110")

Try the cpp4r package in your browser

Any scripts or data that you put into this service are public.

cpp4r documentation built on July 21, 2026, 5:06 p.m.