Skip to content

Commit

Permalink
feat: show input data when running 'boj run'
Browse files Browse the repository at this point in the history
  • Loading branch information
xvzc committed Feb 23, 2024
1 parent 48007ca commit 119176a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions boj/commands/add/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ def execute(self, args):

Path(boj_info.source_path(abs_=True)).touch()
source_code = self.text_file_repository.find(
query=boj_info.source_path(abs_=False),
cwd=config.workspace.problem_dir(args.problem_id),
query=boj_info.source_path(abs_=False),
)
boj_info.checksum = self.text_file_repository.hash(source_code)

Expand All @@ -101,5 +101,5 @@ def populate_template_files(
obj=file,
dest=os.path.join(dest_dir, filename),
)
except ResourceNotFoundError as e:
except ResourceNotFoundError:
self.console.log(f"Skipped '{filename}' since it doesn't exist.")
4 changes: 4 additions & 0 deletions boj/commands/run/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,12 @@ def run_testcases(self):
self.__console.log(
f"• {create_case_label(label_width, output.testcase.label)}[{output.color}]OUTPUT"
)
self.__console.log("[magenta]Input:")
self.__console.log(f"[white]{output.testcase.input}", end="")

self.__console.log("[magenta]Expected:")
self.__console.log(f"[white]{output.testcase.output}", end="")

self.__console.log("[magenta]Yours:")
self.__console.log(f"[white]{output.text}", end="")

Expand Down

0 comments on commit 119176a

Please sign in to comment.