From e5bbd418ea0f5a370c45572721e0df16cdc959c3 Mon Sep 17 00:00:00 2001 From: xvzc Date: Thu, 11 Jul 2024 14:14:03 +0900 Subject: [PATCH] fix: replace CRLF to LF for input data --- boj/core/browser.py | 2 +- boj/data/testcase.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/boj/core/browser.py b/boj/core/browser.py index 4fb09b6..a907413 100644 --- a/boj/core/browser.py +++ b/boj/core/browser.py @@ -6,7 +6,7 @@ from webdriver_manager.firefox import GeckoDriverManager from boj.core import constant -from boj.core.error import IllegalStatementError +from boj.core.error import IllegalStatementError, FatalError class RemoteWebDriver: diff --git a/boj/data/testcase.py b/boj/data/testcase.py index 855a1b4..88832af 100644 --- a/boj/data/testcase.py +++ b/boj/data/testcase.py @@ -3,6 +3,10 @@ from boj.core.fs.file_object import TextFile, FileMetadata +def replace_crlf(s: str): + return s.replace('\r\n', '\n') + + def normalize(s: str): s = s.rstrip() normalized_text = "\n".join([line.rstrip() for line in s.splitlines()]).rstrip() @@ -19,7 +23,7 @@ def __init__(self, label: str, input_: str, output: str): @property def input(self): - return normalize(self.__input) + return replace_crlf(self.__input) @property def output(self):