测试评估
| 指标 | 结果 |
|---|---|
| Base 测试 | PASS |
| Plus 测试 | PASS |
| 代码长度 | 403 字符 |
模型生成的代码 (403 字符)
def check_type(tup):
"""
Check if all the elements in a tuple have the same data type.
Args:
tup (tuple): The input tuple.
Returns:
bool: True if all elements have the same type, False otherwise.
"""
if not tup: # Empty tuple: vacuously True
return True
first_type = type(tup[0])
return all(isinstance(elem, first_type) for elem in tup)
Base 失败测试用例
- 无失败测试
Plus 失败测试用例
- 无失败测试