tests/testthat/test_matchFunctionSignature.R

context("matchFunctionSignature")

test_that("matchFunctionSignature", {
  expect_false(matchFunctionSignature(NULL))
  expect_true(matchFunctionSignature(function(){}))
  expect_false(matchFunctionSignature(function(x){}))
  expect_true(matchFunctionSignature(sum, function(..., na.rm = FALSE) { NULL }))
  expect_false(matchFunctionSignature(sum, function(..., na.rm) { NULL }))
  expect_false(matchFunctionSignature(function(a, b = a) {}, function(b, a = b) {}))
})

Try the wyz.code.offensiveProgramming package in your browser

Any scripts or data that you put into this service are public.

wyz.code.offensiveProgramming documentation built on Sept. 25, 2023, 9:05 a.m.