tests/testthat/test-debug.R

context("test-debug")

test_that("debug works", {

  patterns <- c('a' = 1, 'b' = 2)

  expect_output(lex("12", patterns, debug = TRUE), ".missing")
})




test_that(".missing handled works", {

  patterns <- c('a' = 1, 'b' = 2)

  expect_warning(res <- lex("123", patterns), "were not captured")

  expect_identical(names(res), c('a', 'b', '.missing'))
})
coolbutuseless/minilexer documentation built on May 14, 2019, 6:09 a.m.