File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -284,17 +284,19 @@ def print_sorted(problems: list[Problem]) -> None:
284284
285285
286286def split_submissions_and_testcases (s : list [Path ]) -> tuple [list [Path ], list [Path ]]:
287- # Everything containing data/, .in, or .ans goes into testcases.
287+ # We try to identify testcases by common directory names and common suffixes
288288 submissions = []
289289 testcases = []
290290 for p in s :
291- ps = str (p )
292- if "data" in ps or "sample" in ps or "secret" in ps or ".in" in ps or ".ans" in ps :
293- # Strip potential .ans and .in
294- if p .suffix in [".ans" , ".in" ]:
295- testcases .append (p .with_suffix ("" ))
296- else :
297- testcases .append (p )
291+ testcase_dirs = ["data" , "sample" , "secret" , "fuzz" ]
292+ if (
293+ any (part in testcase_dirs for part in p .parts )
294+ or p .suffix in config .KNOWN_DATA_EXTENSIONS
295+ ):
296+ # Strip potential suffix
297+ if p .suffix in config .KNOWN_DATA_EXTENSIONS :
298+ p = p .with_suffix ("" )
299+ testcases .append (p )
298300 else :
299301 submissions .append (p )
300302 return (submissions , testcases )
You can’t perform that action at this time.
0 commit comments