测试评估
| 指标 | 结果 |
|---|---|
| Base 测试 | PASS |
| Plus 测试 | PASS |
| 代码长度 | 473 字符 |
模型生成的代码 (473 字符)
def occurance_substring(string, substring):
"""
Find the first occurrence and position of a substring within a string.
Args:
string (str): The string to search within.
substring (str): The substring to search for.
Returns:
tuple: (substring, start_index, end_index) if found, else None.
"""
index = string.find(substring)
if index == -1:
return None
return (substring, index, index + len(substring))
Base 失败测试用例
- 无失败测试
Plus 失败测试用例
- 无失败测试