mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 09:38:19 +08:00
utils: add test for subtask matcher
This commit is contained in:
3 files changed
+67
-2
No files matched your search
@@ -240,7 +240,7 @@ interface MatchRule {
|
||||
|
||||
const SubtaskMatcher: MatchRule[] = [
|
||||
{
|
||||
regex: /^(([A-Za-z0-9]*?)(?:(\d*)[-_])?(\d+))\.(in|txt)$/,
|
||||
regex: /^(([A-Za-z0-9._-]*?)(?:(\d*)[-_])?(\d+))\.(in|txt)$/,
|
||||
output: [
|
||||
(a) => `${a[1]}.out`,
|
||||
(a) => `${a[1]}.ans`,
|
||||
@@ -332,6 +332,7 @@ export function readSubtasksFromFiles(files: string[], config) {
|
||||
memory: config.memory,
|
||||
type,
|
||||
cases: [c],
|
||||
id: sid,
|
||||
};
|
||||
} else if (!subtask[sid].cases) subtask[sid].cases = [c];
|
||||
else subtask[sid].cases.push(c);
|
||||
|
||||
Reference in new issue
Block a user