tests/testthat/test-setMetadata.R

test_that("setMetadata works", {
    params <- NS_params
    params <- setMetadata(params, title = "title", 
                          description = "description",
                          authors = "Gustav Delius",
                          new = "new")
    metadata <- getMetadata(params)
    expect_identical(metadata$title, "title")
    expect_identical(metadata$description, "description")
    expect_identical(metadata$authors, "Gustav Delius")
    expect_identical(metadata$new, "new")
    
    params <- setMetadata(params, title = "new",
                          new = NULL)
    metadata <- getMetadata(params)
    expect_identical(metadata$title, "new")
    expect_null(metadata$new)
})

Try the mizer package in your browser

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

mizer documentation built on April 26, 2023, 5:12 p.m.