tests/testthat/test-list_flatten.R

describe("list_flatten", {
    test_list <- generate_test_list()
    it("returns a list without sublists", {
        expect_true(any(sapply(test_list, inherits, "list")))
        flat <- list_flatten(test_list)
        expect_false(any(sapply(flat, inherits, "list")))
    })
})

Try the listr package in your browser

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

listr documentation built on Oct. 6, 2022, 5:11 p.m.