Files
designcraft/apps
Hamza 8d17aa1100 test(cli): show that --nope reached the file system, not the parser
The assertion was that the complaint names `--nope`, which a parser rejecting
unknown options would do just as well -- so it did not pin the thing the test is
named for (noted in review).

`validate-pdf --nope` and `validate-pdf nope.pdf` are now compared with the name
taken out, so the shape of the failure has to be the one an ordinary missing path
gets. That holds the behaviour without asserting the operating system's wording
for a missing file, which an earlier round of review rightly took out of here.

Review suggested asserting the JSON report instead. There is none to assert:
`validate-pdf --nope` fails at `std::fs::read`, before any check runs, and
writes nothing to stdout -- which `failed` already requires.

Controlled by adding `o if o.starts_with("--") => return Err(...)` to
`validate_pdf`:

    left:  "designcraft-cli: unknown option <name>\n"
    right: "designcraft-cli: <name>: No such file or directory (os error 2)\n"

The old assertion passes against that left-hand side, since it names `--nope`.
2026-11-02 16:02:59 +05:00
..