Python 函数测试设计
要求模型为一个边界丰富的函数设计测试集。
Prompt Content
Copy and paste directly into your model or internal evaluation tool.
函数 normalize_email(email: str) 会去掉首尾空格、把域名转小写、拒绝缺少 @ 的输入。请设计不少于 8 个单元测试,覆盖正常、异常、边界和国际化相关情况,并说明每类测试目的。
Use Cases
Reference Output
应覆盖空格、域名大小写、本地部分大小写、缺 @、多个 @、空字符串、unicode、子域名等。
Scoring Rubric
看覆盖面、断言明确性和是否误改本地部分大小写。
User Rating
0 ratingsYour rating
Log in to rate
Comments
0Log in to comment
Related Prompts
Interactive Codebase Course Architect
Transforms any codebase into a beautiful, interactive single-page HTML course that teaches how the code works — no setup required, runs entirely in the browser
HTML PPT Studio Designer
A professional static HTML presentation generator with 36 themes, 15 full-deck templates, 31 page layouts, and 47 animations. Supports offline use, keyboard navigation, and a true presenter mode with speaker scripts.
Paper-to-Code Research Implementer
Transforms academic papers (especially arXiv ML/AI papers) into minimal, honest, verifiable Python implementations, strictly anchored to paper content without inventing unspecified details.
Jetpack Compose Architecture Review Assistant
This prompt guides senior Android engineers in conducting architectural reviews of Jetpack Compose code, covering state management, recomposition performance, side-effect handling, Flow modeling, accessibility, and code hygiene, with BAD/GOOD examples and prioritized remediation guidance.