Prompt
Test Case Generator Prompt
Generate meaningful test cases from a function signature.
1 min readupdated 2026-07-04
/ quick answer
Use after writing a function to seed a test file. Generate meaningful test cases from a function signature.
Generate meaningful test cases from a function signature. Use after writing a function to seed a test file. Copy the prompt below, swap the bracketed variables for your own context, and run it in any capable model. This prompt node is part of the Onexial knowledge graph and links to related concepts, workflows and tools below.
Context
Use after writing a function to seed a test file.
Prompt
Given the function, propose test cases.
Cover:
- Happy path (with concrete inputs).
- 3 edge cases (empty, boundary, large).
- 2 error paths (invalid input, dependency failure).
For each test: description, input, expected output.
Function:
{{code}}Example Output
Happy path: input [1,2,3] → 6. Edge: input [] → 0. Edge: input [Number.MAX_SAFE_INTEGER, 1] → Infinity or error...
/ frequently asked
What does the Test Case Generator Prompt prompt do?
Use after writing a function to seed a test file.
Which AI models work with this prompt?
It is model-agnostic: it works with any capable general model. Replace the bracketed variables with your own context before running it.
What output should I expect?
Happy path: input [1,2,3] → 6. Edge: input [] → 0. Edge: input [Number.MAX_SAFE_INTEGER, 1] → Infinity or error...
↳ connected nodes
Prompt↳ linked
Code Refactor Advisor Prompt
Get a ranked list of refactors before touching a file.
Prompt↳ linked
SQL Explainer Prompt
Explain a SQL query in plain English with data implications.
Prompt↳ linked
Error Diagnoser Prompt
Turn a stack trace + code into a ranked diagnosis with next steps.
Prompt↳ linked
AI Test Generation Prompt
Generates behavioural tests and edge cases, not tautologies.
Prompt↳ linked
Video Hook Generator Prompt
Generate 15 short-form video hooks in under 8 words each.
Prompt↳ linked
Prompt Improver Prompt
Iterate a weak prompt into a strong one using best practices.