tests/testthat/test-rmatch_calls.R

context("rmatch_calls")

test_that("Omitted leading or trailing zeros don't cause mismatch.", {
  testv <- parse(text="seq(1, 10, by=0.5);  seq(1, 10, by=.5); seq(1, 10, by=.50)")
  iscorrect <- is_identical_to(rmatch_calls(testv[[1]]))
  for(v in testv){
    expect_that(rmatch_calls(v), iscorrect)
  }
  invisible()
})

test_that("Omission, inclusion, or order of named arguments doesn't cause mismatch.", {
  testv <- parse(text="seq(1, 10, by=0.5);  seq(to=10, from=1, by=0.5); seq(1, 10, 0.50, length.out=NULL)")
  iscorrect <- is_identical_to(rmatch_calls(testv[[1]]))
  for(v in testv){
    expect_that(rmatch_calls(v), iscorrect)
  }
  invisible()
})
ncarchedi/omnitest documentation built on May 23, 2019, 1:05 p.m.