context("test-subfield_extractor.R")
test_that("subfield_extractor character vector", {
library(stringr)
library(magrittr)
test_string <- "##$aakfkejbne KJNL$bjygklLJG$bKGjlbhkht$cIUGhb uhv$ejhvkhgGC brtn"
expect_equal(subfield_extractor(test_string, "$a"), "akfkejbne KJNL")
expect_equal(subfield_extractor(test_string, "$b"), c("jygklLJG", "KGjlbhkht"))
expect_equal(subfield_extractor(test_string, "$e"), "jhvkhgGC brtn")
expect_equal(subfield_extractor(test_string, "$d"), NULL)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.