MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / buildTestCases

Function buildTestCases

packages/migrate/scripts/jnoj.ts:578–598  ·  view source on GitHub ↗
(runInfo: string)

Source from the content-addressed store, hash-verified

576 4: 'pas',
577 };
578 const buildTestCases = (runInfo: string) => {
579 try {
580 const info = JSON.parse(runInfo);
581 return {
582 testCases: info.subtasks.flatMap((subtask: any, subtaskId: number) => subtask.cases.map((cas: any, caseId: number) => ({
583 subtaskId: subtaskId + 1,
584 id: caseId + 1,
585 status: statusMap[cas.verdict] || STATUS.STATUS_WAITING,
586 time: cas.time || 0,
587 memory: cas.memory || 0,
588 message: cas.checker_log
589 || (cas.exit_code ? `Exit code: ${cas.exit_code}`
590 : cas.checker_exit_code ? `Checker exit code: ${cas.checker_exit_code}` : ''),
591 }))),
592 };
593 } catch (e) {
594 return {
595 compilerTexts: [runInfo],
596 };
597 }
598 };
599
600 const [{ 'count(*)': rcount }] = await query('SELECT count(*) FROM `solution` WHERE `problem_id` > 0 AND `status` != 2');
601 const attended = {};

Callers 1

runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected