Easy PromptAI Prompt Library
CodingCodeIntermediate

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 ratings
-

Your rating

Log in to rate

Comments

0

Log in to comment

Related Prompts

CodeCoding

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

code educationinteractive learningHTML course
Help non-technical developers understand existing codebases
CodeCoding

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.

HTML presentationstatic websitepresenter mode
Creating offline-capable presentations without server dependencies
CodeCoding

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.

paper implementationcode generationmachine learning
Researchers quickly reproduce core algorithms from arXiv papers
CodeCoding

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.

Jetpack ComposeAndroid ArchitectureState Management
Systematically audit Compose implementations in team code reviews