judge: output length check

This commit is contained in:
undefined committed 2022-03-28 02:33:14 +08:00
1 parent ab788b3d79
commit 37a6a0365c
3 files changed
+6 -4

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@hydrooj/hydrojudge",
"bin": "bin/hydrojudge.js",
"version": "2.15.3",
"version": "2.15.4",
"main": "package.json",
"author": "undefined <i@undefined.moe>",
"repository": "https://github.com/hydro-dev/Hydro.git",
+3 -2
View File
@@ -91,7 +91,7 @@ function judgeCase(c: Case, sid: string) {
await runner(ctx, ctxSubtask);
return;
}
if ([STATUS.STATUS_WRONG_ANSWER, STATUS.STATUS_RUNTIME_ERROR].includes(status) && ctx.config.detail) {
if ([STATUS.STATUS_WRONG_ANSWER, STATUS.STATUS_RUNTIME_ERROR].includes(status)) {
const langConfig = ctx.getLang(ctx.lang);
if (langConfig.analysis && !ctx.analysis) {
ctx.analysis = true;
@@ -106,7 +106,8 @@ function judgeCase(c: Case, sid: string) {
time: 5000,
memory: 256,
}).then((r) => {
ctx.next({ compiler_text: r.stdout.toString().substring(0, 1024) });
const out = r.stdout.toString();
if (out.length) ctx.next({ compiler_text: out.substring(0, 1024) });
if (process.env.DEV) console.log(r);
});
}
+2 -1
View File
@@ -99,7 +99,8 @@ export const judge = async (ctx: Context) => {
time: 5000,
memory: 256,
}).then((r) => {
ctx.next({ compiler_text: r.stdout.toString().substring(0, 1024) });
const out = r.stdout.toString();
if (out.length) ctx.next({ compiler_text: out.substring(0, 1024) });
if (process.env.DEV) console.log(r);
});
}