feat: diff.output.xxx -> diff.xxx #26

Merged
张泊明518370910136 merged 3 commits from feat/better-diff into master 2025-06-22 01:59:20 +08:00
2 changed files with 6 additions and 9 deletions
Showing only changes of commit a79f36bc0e - Show all commits

View File

@ -139,7 +139,7 @@ class Parser(str, Enum):
ELF = "elf"
class CaseBase(BaseModel):
class Case(BaseModel):
env: List[str] = []
command: str = "" # Command to run
files: StageFiles = StageFiles()
@ -149,13 +149,10 @@ class CaseBase(BaseModel):
True, validation_alias=AliasChoices("copy-in-cwd", "copy_in_cwd")
)
limit: Limit = Limit()
class DictCase(CaseBase):
diff: ParserDiff = ParserDiff()
class Stage(CaseBase):
class Stage(Case):
name: str = "" # stage name
skip: List[str] = []
@ -175,9 +172,9 @@ class Stage(CaseBase):
validation_alias=AliasChoices("result-detail", "result_detail"),
)
file: ParserFile = ParserFile()
diff: ParserDiff = ParserDiff()
# diff: ParserDiff = ParserDiff() # inherited from Case
cases: Dict[str, DictCase] = {}
cases: Dict[str, Case] = {}
model_config = ConfigDict(extra="allow")

View File

@ -276,7 +276,7 @@ def fix_diff(
def get_unspecified_cases(
task_root: Path, task_path: Path, cases: Dict[str, task.DictCase]
task_root: Path, task_path: Path, cases: Dict[str, task.Case]
) -> List[str]:
testcases = set()
for testcases_path in (task_root / task_path).parent.glob("**/*.in"):
@ -306,7 +306,7 @@ def get_unspecified_cases(
def get_stdin_stdout(
task_root: Path, task_path: Path, case_name: str, case: task.DictCase
task_root: Path, task_path: Path, case_name: str, case: task.Case
) -> Tuple[result.Stdin, Optional[str]]:
case_stdout_name = case.out_ if case.out_ else f"{case_name}.out"
stdin: result.Stdin = result.MemoryFile(content="")