测试评估
| 指标 | 结果 |
|---|---|
| Base 测试 | PASS |
| Plus 测试 | PASS |
| 代码长度 | 531 字符 |
模型生成的代码 (531 字符)
import re
def find_literals(text: str, pattern: str):
"""
Search a string for a regex pattern and return the matching substring,
start index, and end index.
Args:
text: The input string to search.
pattern: The regex pattern to look for.
Returns:
A tuple (matched_substring, start_index, end_index) if a match is found,
otherwise None.
"""
match = re.search(pattern, text)
if match:
return (match.group(), match.start(), match.end())
return None
Base 失败测试用例
- 无失败测试
Plus 失败测试用例
- 无失败测试