Commit c8cfcee8 authored by liziwl's avatar liziwl
Browse files

fix(test): 修复 test-files.py 中的正则表达式

- 在 change_line 函数中,将 "type = \S+," 修改为 "(?<!\S)type = \S+,"
- 这个改动确保了只匹配那些前面没有其他字符的 "type =",避免了错误的替换
- 此修复影响了两个地方:一个是将类型改为 progress,另一个是将类型改为 proposal
parent 7786cdfa
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -123,7 +123,7 @@ if __name__ == "__main__":
        backup(filename, TOBACKUP)
        if not args.undo:
            change_line(filename,
                        "type = \S+,",
                        "(?<!\S)type = \S+,",
                        "type = progress,"
                        )
    elif args.recipe == 5:
@@ -132,6 +132,6 @@ if __name__ == "__main__":
        backup(filename, TOBACKUP)
        if not args.undo:
            change_line(filename,
                        "type = \S+,",
                        "(?<!\S)type = \S+,",
                        "type = proposal,"
                        )
 No newline at end of file