utils: update testcase parser

This commit is contained in:
undefined committed 2024-01-18 13:57:49 +08:00
1 parent 911676b050
commit f25fb402cd
8 files changed
+23 -31

No files matched your search

+3 -4
View File
@@ -40,7 +40,7 @@
"@types/semver": "^7.5.6",
"autocannon": "^7.14.0",
"cac": "^6.7.14",
"chai": "^4.4.0",
"chai": "^5.0.0",
"chokidar": "^3.5.3",
"cross-env": "^7.0.3",
"cross-spawn": "^7.0.3",
@@ -51,14 +51,13 @@
"fs-extra": "^11.2.0",
"globby": "14.0.0",
"inspectpack": "^4.7.1",
"mongodb": "^5.9.2",
"mongodb-memory-server": "^9.1.4",
"mongodb-memory-server": "^9.1.6",
"nyc": "^15.1.0",
"ora": "^7.0.1",
"package-json": "^8.1.1",
"semver": "^7.5.4",
"simple-git": "^3.22.0",
"supertest": "^6.3.3",
"supertest": "^6.3.4",
"typescript": "^5.3.3",
"wtfnode": "^0.9.1"
}
+2 -2
View File
@@ -4,8 +4,8 @@
"license": "MIT",
"main": "react.yaml",
"dependencies": {
"@typescript-eslint/eslint-plugin": "^6.17.0",
"@typescript-eslint/parser": "^6.17.0",
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@typescript-eslint/parser": "^6.19.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint-plugin-github": "^4.10.1",
+1 -1
View File
@@ -59,7 +59,7 @@
"@types/adm-zip": "^0.4.34",
"@types/fs-extra": "^11.0.4",
"@types/js-yaml": "^4.0.9",
"@types/koa": "^2.13.12",
"@types/koa": "^2.14.0",
"@types/koa-compress": "^4.0.6",
"@types/koa-router": "^7.4.8",
"@types/koa-static-cache": "^5.1.4",
+8 -8
View File
@@ -14,7 +14,7 @@
"cli": false
},
"devDependencies": {
"@blueprintjs/core": "^5.7.2",
"@blueprintjs/core": "^5.8.2",
"@fontsource/dm-mono": "^5.0.18",
"@fontsource/fira-code": "^5.0.16",
"@fontsource/inconsolata": "^5.0.16",
@@ -34,14 +34,14 @@
"@types/nunjucks": "^3.2.6",
"@types/pickadate": "^3.5.35",
"@types/qrcode": "^1.5.5",
"@types/react": "^18.2.46",
"@types/react": "^18.2.47",
"@types/react-dom": "^18.2.18",
"@types/redux-logger": "^3.0.12",
"@types/webpack-env": "^1.18.4",
"@vscode/codicons": "^0.0.35",
"ajv": "^8.12.0",
"allotment": "^1.19.5",
"autoprefixer": "^10.4.16",
"allotment": "^1.20.0",
"autoprefixer": "^10.4.17",
"browser-update": "^3.3.44",
"chalk": "^5.3.0",
"classnames": "^2.5.1",
@@ -49,7 +49,7 @@
"clipboard": "^2.0.11",
"copy-webpack-plugin": "^11.0.0",
"cordis": "2.8.8",
"css-loader": "^6.8.1",
"css-loader": "^6.9.0",
"diff": "^5.1.0",
"diff-dom": "^5.1.2",
"echarts": "^5.4.3",
@@ -69,7 +69,7 @@
"jquery.easing": "^1.4.1",
"jquery.transit": "^0.9.12",
"matchmedia-polyfill": "^0.3.2",
"mini-css-extract-plugin": "^2.7.6",
"mini-css-extract-plugin": "^2.7.7",
"moment": "^2.30.1",
"monaco-editor": "0.45.0",
"monaco-editor-nls": "^3.1.0",
@@ -95,7 +95,7 @@
"react-dnd-html5-backend": "^16.0.1",
"react-dom": "^18.2.0",
"react-query": "^3.39.3",
"react-redux": "^9.0.4",
"react-redux": "^9.1.0",
"reconnecting-websocket": "^4.4.0",
"redux": "^5.0.1",
"redux-logger": "^3.0.6",
@@ -105,7 +105,7 @@
"schemastery": "^3.14.3",
"slideout": "^1.0.1",
"sticky-kit": "^1.1.3",
"style-loader": "^3.3.3",
"style-loader": "^3.3.4",
"stylus": "^0.62.0",
"stylus-loader": "7.1.2",
"tether": "1.4.7",
@@ -35,7 +35,6 @@
</h1>
<div class="footer__category__expander"><ul class="footer__category__list">
<li class="footer__category__item"><a href="{{ url('wiki_help') }}">{{ _('Help') }}</a></li>
<!--<li class="footer__category__item"><a href="#">{{ _('Blog') }}</a></li>-->
<li class="footer__category__item"><a href="{{ url('wiki_about', anchor='contact') }}">{{ _('QQ Group') }}</a></li>
</ul></div>
</div>
+5 -1
View File
@@ -240,10 +240,12 @@ interface MatchRule {
const SubtaskMatcher: MatchRule[] = [
{
regex: /^(([A-Za-z0-9._-]*?)(?:(\d*)[-_])?(\d+))\.(in|txt)$/,
regex: /^(([A-Za-z0-9._-]*?)(?:(\d*)[-_])?(\d+))\.(in|txt|in\.txt)$/,
output: [
(a) => `${a[1]}.out`,
(a) => `${a[1]}.out.txt`,
(a) => `${a[1]}.ans`,
(a) => `${a[1]}.ans.txt`,
(a) => `${a[1]}.out`.replace(/input/g, 'output'),
(a) => (a[1].includes('input') ? `${a[1]}.txt`.replace(/input/g, 'output') : null),
],
@@ -256,6 +258,8 @@ const SubtaskMatcher: MatchRule[] = [
output: [
(a) => `${a[1]}.ou${a[2]}`,
(a) => `${a[1]}.ou${a[2]}`.replace(/input/g, 'output'),
(a) => `${a[1]}.out${a[2]}`,
(a) => `${a[1]}.out${a[2]}`.replace(/input/g, 'output'),
],
id: (a) => +a[2],
subtask: () => 1,
+3 -13
View File
@@ -52,21 +52,11 @@ require.extensions['.js'] = function loader(module, filename) {
const content = fs.readFileSync(filename, 'utf-8');
return module._compile(content, filename);
} catch (e) { // ESM
try {
return module._compile(transform(filename), filename);
} catch (err) {
err.stack = new Error().stack;
throw err;
}
return module._compile(transform(filename), filename);
}
};
require.extensions['.ts'] = require.extensions['.tsx'] = function loader(module, filename) {
try {
return module._compile(transform(filename), filename);
} catch (e) {
e.stack = new Error().stack;
throw e;
}
return module._compile(transform(filename), filename);
};
require.extensions['.jsc'] = function loader(module, filename) {
const buf = fs.readFileSync(filename);
@@ -101,4 +91,4 @@ if (argv.options.debug) {
console.log('Debug mode enabled');
process.env.NODE_ENV = 'development';
process.env.DEV = 'on';
} else process.env.NODE_ENV = process.env.NODE_ENV || 'production';
} else process.env.NODE_ENV ||= 'production';
+1 -1
View File
@@ -9,7 +9,7 @@
"preferUnplugged": true,
"dependencies": {
"@hydrooj/utils": "workspace:*",
"jsdom": "^23.1.0",
"jsdom": "^23.2.0",
"superagent-charset": "^1.2.0",
"superagent-proxy": "^3.0.0"
},