Skip to content

Add consistent way to access user-defined arguments from function passed to  #18

@selkamand

Description

@selkamand

we have arg_name to access deparse(substitute(x)) - called from within the assertion,
but how can we get the relevant 'name' of arg2 such that if a user calls assert_test(1:5, 10:12) the error message says
'1:5 is our first argument, 10:12 is our second'

# Create an assertion-powering function
test_advanced <- function(x, arg2){
  return("{arg_name} is our first argument. {name(arg2)} is our second.")
}

assert_test <- assert_create(
  test_advanced
  )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions