library(pkEML)
test_that("null2na works as expected", {
expect_equal(null2na(NULL), NA)
expect_equal(null2na(list()), NA)
expect_equal(null2na(" "), NA)
})
test_that("parse_packageId", {
expect_equal(parse_packageId("knb-lter-ble.1.2"), list(scope = "knb-lter-ble", id = "1", rev = "2"))
expect_equal(parse_packageId("doi:10.5063/F1K64GHT
"), list(scope = NA, id = "doi:10.5063/F1K64GHT
", rev = NA))
expect_equal(parse_packageId("urn:uuid:6229a977-0986-4f1f-a8df-1d5101131eaf"), list(scope = NA, id = "urn:uuid:6229a977-0986-4f1f-a8df-1d5101131eaf", rev = NA))
})
test_that("recursive_check", {
expect_true(recursive_check(list(a = list(b = list(c = "item"))), c("a", "b")))
expect_true(recursive_check(list(a = list(b = list(c = "item"))), c("a", "b", "c")))
expect_false(recursive_check(list(a = list(b = list(c = "item"))), c("a", "c")))
expect_false(recursive_check(list(a = list(b = list(c = "item"), c = "d")), c("a", "c", "c")))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.