Generates unit test code for an R function using the Gemini AI model.
Arguments
- prompt
A character string specifying additional instructions for the Gemini model.
If NULL, a default prompt requesting unit tests is used.
Value
Invisibly returns the generated test code, but primarily inserts it into the RStudio console.
Examples
if (FALSE) { # \dontrun{
# Select your function code in the editor, then run:
gen_tests()
# For custom instructions:
gen_tests("Generate comprehensive testthat tests with edge cases")
} # }