fix(diff): bugs on diff stdin and numerics #16

Merged
张泊明518370910136 merged 22 commits from fix/diff into master 2025-05-24 02:45:39 +08:00
3 changed files with 4 additions and 20 deletions
Showing only changes of commit 7265411abe - Show all commits

View File

@ -13,6 +13,7 @@ from joj3_config_generator.models.const import (
JOJ3_CONFIG_ROOT,
)
from joj3_config_generator.models.task import Parser as ParserEnum
from joj3_config_generator.utils.logger import logger
def get_conf_stage(
@ -255,12 +256,12 @@ def get_testcases(
) -> Set[str]: # basedir here should be task_conf.root / task_conf.path
testcases = set()
for testcases_path in (task_root / task_path).parent.glob("**/*.in"):
if not os.path.exists(str(testcases_path).removesuffix(".in") + ".out"):
jon-lee marked this conversation as resolved

if not testcases_path.with_suffix(".out").exists():

`if not testcases_path.with_suffix(".out").exists():`

done

done
logger.warning(f"Testcase {testcases_path} has no corresponding .out file")
continue
testcases.add(
str(
jon-lee marked this conversation as resolved Outdated

No. Just do not append it to the return value and log a warning.

No. Just do not append it to the return value and log a warning.

we can probably move some redundant functions like get_testcaes into a utils.py as file llines already bit large

we can probably move some redundant functions like `get_testcaes` into a `utils.py` as file llines already bit large

leave it here now. we have not reused the logic.

leave it here now. we have not reused the logic.
testcases_path.relative_to((task_root / task_path).parent)
).removesuffix(".in")
)
assert os.path.exists(
str(testcases_path).removesuffix(".in") + ".out"
), f"{testcases_path} does not have a corresponding *.out file!"
return testcases

View File

@ -111,11 +111,6 @@
"src": "/home/tt/.config/joj/diff/case2.in"
}
},
{
"stdin": {
"src": "/home/tt/.config/joj/diff/case3.in"
}
},
{
"stdin": {
"src": "/home/tt/.config/joj/diff/task1/case4.in"
@ -229,18 +224,6 @@
}
]
},
{
"outputs": [
{
"score": 100,
"fileName": "stdout",
"answerPath": "/home/tt/.config/joj/diff/case3.out",
"forceQuitOnDiff": false,
"alwaysHide": false,
"compareSpace": false
}
]
},
{
"outputs": [
{