Skip to content

Commit 11ca42f

Browse files
committed
when doing line-matching, check for # This is a test template in the line
1 parent 7aa3f03 commit 11ca42f

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

fuzz/collect_fuzz_python.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,11 @@ def __init__(self, idx, fuzz_input):
378378
def visit_FunctionDef(self, node):
379379
if node.name == "test_":
380380
self.found_test_function = True
381-
# 遍历函数体,寻找包含注释的赋值语句
381+
382+
# 1. 修改函数名
383+
node.name = f"test_{self.idx}"
384+
385+
# 2. 查找并替换包含特定注释的赋值语句
382386
for i, stmt in enumerate(node.body):
383387
# 检查是否是赋值语句
384388
if isinstance(stmt, ast.Assign):

0 commit comments

Comments
 (0)