tests/testthat/test-llm_commands.R

test_that("validate_command_args - valid args", {
  command <- list(parameters = list(list(name = "param_1"), list(name = "param_2")))
  args <- list(param_1 = "value_1", param_2 = "value_2")
  expect_true(validate_command_args(command, args))
})

test_that("validate_command_args - extra (unused) args", {
  command <- list(parameters = list(list(name = "param_1"), list(name = "param_2")))
  args <- list(param_1 = "value_1", param_2 = "value_2", param_3 = "value_3")
  expect_true(validate_command_args(command, args))
})

test_that("validate_command_args - missing args", {
  command <- list(parameters = list(list(name = "param_1"), list(name = "param_2")))
  args <- list(param_1 = "value_1")
  expect_false(validate_command_args(command, args))
})

Try the myownrobs package in your browser

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

myownrobs documentation built on Nov. 5, 2025, 5:52 p.m.