context("flag validation")
test_that("parsing is ok", {
expect_equal(valid_flag("op"), "-op")
expect_equal(valid_flag("-op"), "-op")
expect_equal(valid_flag(" -op "), "-op")
expect_equal(valid_flag(" op "), "-op")
expect_equal(valid_flag("-op "), "-op")
# edge case
expect_equal(valid_flag(" - o p "), "-op")
# long options
expect_equal(valid_flag("h", mark = "--"), "--h")
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.