Skip to content

Commit 52ea83d

Browse files
committed
Robuster finding judge error tc path
1 parent 2923b1e commit 52ea83d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

problemtools/verifyproblem.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,9 @@ def check(self, context: Context) -> bool:
285285
if not self._problem.is_interactive():
286286
val_res = self._problem.output_validators.validate(self, self.ansfile)
287287
if val_res.verdict != 'AC':
288-
ans_path = Path(self.ansfile)
289-
testcase_relative_data = Path(*ans_path.parts[ans_path.parts.index("data"):])
288+
parts = Path(self.ansfile).parts
289+
idx = len(parts) - 1 - parts[::-1].index("data") # Last occurrence of "data"
290+
testcase_relative_data = Path(*parts[idx:])
290291

291292
if self.is_in_sample_group():
292293
self.error(f'judge answer file got {val_res} on testcase {testcase_relative_data}')

0 commit comments

Comments
 (0)