Volkov: добавить Sprinter Commander
Реализовать двухпанельный Commander от платформенного PoC до этапов P6-P20: EMM-каталог, сортировку и выбор, операции с файлами и деревьями, транзакционное копирование, метаданные, политику конфликтов и предварительную проверку свободного места. Добавить проектную документацию, HDD/MAME-сценарии и проверенные артефакты. Расширить libc операцией bank_write_page, исправлением режима O_RDONLY и связанными регрессионными проверками.
This commit is contained in:
+65
@@ -0,0 +1,65 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Создаёт UI-каталог выбора и проверяет SELRES.TXT target-пробы."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pathlib
|
||||
import sys
|
||||
|
||||
|
||||
def create(root: pathlib.Path) -> None:
|
||||
panel = root / "SELECT"
|
||||
panel.mkdir(parents=True)
|
||||
(panel / "ADIR").mkdir()
|
||||
(panel / "ZDIR").mkdir()
|
||||
for name, size in (("A.BIN", 10), ("B.BIN", 20), ("C.BIN", 30)):
|
||||
(panel / name).write_bytes(bytes((index * 19 + size) & 0xFF
|
||||
for index in range(size)))
|
||||
|
||||
|
||||
def verify(root: pathlib.Path) -> None:
|
||||
result = root / "SELRES.TXT"
|
||||
expected = [
|
||||
"PASS parent cannot be selected",
|
||||
"PASS Insert selects file and advances",
|
||||
"PASS second Insert accumulates size",
|
||||
"PASS DSS marker cannot be selected",
|
||||
"PASS invert changes files only",
|
||||
"PASS second invert restores file selection",
|
||||
"PASS individual Insert may select directory",
|
||||
"PASS clear group ignores selected directory",
|
||||
"PASS mask is ASCII case insensitive",
|
||||
"PASS question wildcard clears matching files",
|
||||
"PASS DOS star-dot-star selects all files only",
|
||||
"PASS group mask never changes directory flag",
|
||||
"PASS refresh clear resets selection totals",
|
||||
"PASS EMM restored",
|
||||
"ALL PASS",
|
||||
]
|
||||
failures: list[str] = []
|
||||
if not result.is_file():
|
||||
failures.append("нет SELRES.TXT")
|
||||
else:
|
||||
text = result.read_bytes().decode("cp866", errors="replace")
|
||||
for line in expected:
|
||||
if line not in text:
|
||||
failures.append(f"нет строки результата: {line}")
|
||||
if failures:
|
||||
for failure in failures:
|
||||
print(f"FAIL: {failure}")
|
||||
raise SystemExit(1)
|
||||
print("PASS: Insert/invert/masks, virtual guards, totals, refresh и EMM.")
|
||||
|
||||
|
||||
def main() -> None:
|
||||
if len(sys.argv) != 3 or sys.argv[1] not in {"create", "verify"}:
|
||||
raise SystemExit(f"usage: {sys.argv[0]} create|verify DIR")
|
||||
root = pathlib.Path(sys.argv[2])
|
||||
if sys.argv[1] == "create":
|
||||
create(root)
|
||||
else:
|
||||
verify(root)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user