Hacker News new | ask | show | jobs
by saghm 48 days ago
I don't think they're trying to say that this is a sufficient test for correctness but a necessary one.
1 comments

Correct. It won't catch 100% of possible bugs, but it will catch most.

The kind of bugs that are easiest to write in a formatter is dropping a bit of syntax on the floor and forgetting to include it in the output, and the sanity check will catch those.

It's also definitely possible to miss some whitespace that's necessary for things like identifier separation, but... <shrug> it's a sanity check, not a proof of correctness.

In practice, that's how most software testing works anyhow!