gen_tests: Generate Unit Tests for R Functions

View source: R/gen_tests.R

gen_testsR Documentation

Generate Unit Tests for R Functions

Description

Generates unit test code for an R function using the Gemini AI model.

Usage

gen_tests(prompt = NULL)

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

## Not run: 
# Select your function code in the editor, then run:
gen_tests()

# For custom instructions:
gen_tests("Generate comprehensive testthat tests with edge cases")

## End(Not run)


gemini.R documentation built on June 20, 2025, 5:07 p.m.

Related to gen_tests in gemini.R...