Skip to content

Commit

Permalink
fix(judge): 测试点的CRLF和LF不兼容
Browse files Browse the repository at this point in the history
Issue: #8
  • Loading branch information
XYCode-Kerman committed Apr 10, 2024
1 parent db09c1d commit 27c3f04
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ccf_parser/problems.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ class CheckPoint(BaseModel):
output_file: Optional[pathlib.Path] = None

def compare(self, output: str) -> bool:
# CRLF转换到LF
self.answer = self.answer.replace('\r\n', '\n')
output = output.replace('\r\n', '\n')

return self.answer.strip() == output.strip()


Expand Down

0 comments on commit 27c3f04

Please sign in to comment.