judge: fix testcase matching for inputX.txt

pull/326/head
undefined 3 years ago
parent eeff671c3a
commit 1479a00cad

@ -1,7 +1,7 @@
{
"name": "@hydrooj/hydrojudge",
"bin": "bin/hydrojudge.js",
"version": "2.14.7",
"version": "2.14.8",
"main": "package.json",
"author": "undefined <i@undefined.moe>",
"repository": "https://github.com/hydro-dev/Hydro.git",

@ -25,7 +25,7 @@ const RE0: Re0[] = [
(a) => `${a[1] + a[2]}.out`,
(a) => `${a[1] + a[2]}.ans`,
(a) => `${a[1] + a[2]}.out`.replace(/input/g, 'output'),
(a) => `${a[1] + a[2]}.txt`.replace(/input/g, 'output'),
(a) => (a[1].includes('input') ? `${a[1] + a[2]}.txt`.replace(/input/g, 'output') : null),
],
id: (a) => +a[2],
},
@ -57,7 +57,7 @@ async function read0(folder: string, files: string[], checkFile, cfg) {
for (const func of REG.output) {
if (cfg.noOutputFile) c.output = '/dev/null';
else c.output = func(data);
if (c.output === '/dev/null' || fs.existsSync(path.resolve(folder, c.output))) {
if (c.output && (c.output === '/dev/null' || fs.existsSync(path.resolve(folder, c.output)))) {
cases.push(c);
break;
}

@ -180,7 +180,7 @@ export default class Hydro {
async init() {
await this.setCookie(this.config.cookie || '');
await this.ensureLogin();
setInterval(() => { this.axios.get('judge/noop'); }, 30000000);
setInterval(() => { this.axios.get(''); }, 30000000); // Cookie refresh only
}
async cacheOpen(source: string, files: any[], next?) {

Loading…
Cancel
Save