judge: fix testcase matching for inputX.txt

This commit is contained in:
undefined committed 2022-03-23 16:24:58 +08:00
1 parent eeff671c3a
commit 1479a00cad
3 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -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;
}
+1 -1
View File
@@ -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?) {