From 6db15b35566daf743e8988a20054927f38ff2980 Mon Sep 17 00:00:00 2001 From: undefined Date: Thu, 22 Apr 2021 13:13:11 +0800 Subject: [PATCH] judge: fix testlib interactive --- packages/hydrojudge/package.json | 2 +- packages/hydrojudge/src/judge/interactive.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/hydrojudge/package.json b/packages/hydrojudge/package.json index 9212b25dd..20c8fd266 100644 --- a/packages/hydrojudge/package.json +++ b/packages/hydrojudge/package.json @@ -1,7 +1,7 @@ { "name": "@hydrooj/hydrojudge", "bin": "bin/hydrojudge.js", - "version": "2.5.11", + "version": "2.5.12", "main": "package.json", "author": "undefined ", "repository": "https://github.com/hydro-dev/Hydro.git", diff --git a/packages/hydrojudge/src/judge/interactive.ts b/packages/hydrojudge/src/judge/interactive.ts index 75d182efd..6720c1751 100644 --- a/packages/hydrojudge/src/judge/interactive.ts +++ b/packages/hydrojudge/src/judge/interactive.ts @@ -20,7 +20,6 @@ function judgeCase(c) { return async (ctx, ctxSubtask) => { ctx.executeInteractor.copyIn.in = c.input ? { src: c.input } : { content: '' }; ctx.executeInteractor.copyIn.out = c.output ? { src: c.output } : { content: '' }; - ctx.executeInteractor.copyIn['testlib.h'] = { src: testlibSrc }; const [{ code, time_usage_ms, memory_usage_kb }, resInteractor] = await run([ { execute: ctx.executeUser.execute.replace(/\$\{name\}/g, 'code'), @@ -100,7 +99,9 @@ export const judge = async (ctx) => { return await compile(ctx.lang, ctx.code, 'code', copyIn, ctx.next); })(), (async () => { - const copyIn = {}; + const copyIn = { + 'testlib.h': testlibSrc, + }; for (const file of ctx.config.judge_extra_files) { copyIn[parseFilename(file)] = { src: file }; }