测试评估
| 指标 | 结果 |
|---|---|
| Base 测试 | PASS |
| Plus 测试 | PASS |
| 代码长度 | 481 字符 |
模型生成的代码 (481 字符)
import re
def check_str(s: str) -> bool:
"""
Check if the given string starts with a vowel (a, e, i, o, u), case-insensitive, using regex.
Args:
s: Input string.
Returns:
True if s starts with a vowel, False otherwise.
"""
# Pattern matches start of string followed by a vowel (lowercase or uppercase)
pattern = r'^[aeiouAEIOU]'
# re.match searches from the beginning of the string
return bool(re.match(pattern, s))
Base 失败测试用例
- 无失败测试
Plus 失败测试用例
- 无失败测试