Skip to content

Commit

Permalink
fix: replace CRLF to LF for input data
Browse files Browse the repository at this point in the history
  • Loading branch information
xvzc committed Jul 11, 2024
1 parent 977827a commit e5bbd41
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion boj/core/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 5 additions & 1 deletion boj/data/testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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):
Expand Down

0 comments on commit e5bbd41

Please sign in to comment.