Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Commit b1b778d

Browse files
committed
resove bugs
1 parent 54d96e7 commit b1b778d

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

termicoder/data/config/lang/c/template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ code: |
2727
}
2828
2929
//<> with <3 using termicoder:
30-
//https://temricoder.github.io
30+
//https://termicoder.github.io

termicoder/data/config/lang/cpp/template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ code: |
3939
}
4040
4141
//<> with <3 using termicoder:
42-
//https://temricoder.github.io
42+
//https://termicoder.github.io

termicoder/utils/test.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import os
1010

1111

12+
# TODO refractor code
1213
def test(code_file, timelimit, live, judge_factory):
1314
if '.problem.yml' not in os.listdir():
1415
logger.error("You should be in a problem directory to test")
@@ -76,7 +77,7 @@ def test(code_file, timelimit, live, judge_factory):
7677
testcase_files = []
7778

7879
if live is True:
79-
testcase_files = [sys.stdin]
80+
testcase_files = ["stdin"]
8081

8182
for testcase_file in testcase_files:
8283
if(live or testcase_file.endswith('.in')):
@@ -86,6 +87,7 @@ def test(code_file, timelimit, live, judge_factory):
8687
inp_file = click.open_file(
8788
os.path.join('testcases', "%s.in" % name))
8889
inp = inp_file.read()
90+
inp_file.seek(0)
8991
try:
9092
ans_file = click.open_file(
9193
os.path.join('testcases', "%s.ans" % name))
@@ -122,7 +124,6 @@ def test(code_file, timelimit, live, judge_factory):
122124
timelimit = problem.timelimit
123125

124126
logger.debug(run_command)
125-
126127
p = subprocess.run(run_command, stdin=inp_file,
127128
timeout=timelimit, check=True,
128129
stdout=out_file, stderr=out_file)

0 commit comments

Comments
 (0)