tests/testthat/test_utils.R

context('Utility functions')
library(serpstatr)

test_that('sst_lists_to_df returns a data.frame', {
  expect_equal(
    class(sst_lists_to_df(
      lists = list(
        first_list  = list(a = 1, b = 2),
        second_list = list(a = 2, c = 3)
        ),
      fill  = 'empty'
      )),
    'data.frame'
  )
})

Try the serpstatr package in your browser

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

serpstatr documentation built on Sept. 11, 2024, 7:16 p.m.