HANDS-ON / OMNIDIFF 0.4.0
OmniDiff in practice:
read the result correctly.
By Alvin
Our test files contain a function called fare. before.py returns distance * 2; after.py returns distance * 3. For a distance of 10, those formulas give 20 and 30. The change is deliberate and easy to recognize.
| COMPARISON / OPTION | EXIT CODE / MEANING |
|---|---|
| Same file / --exit-code | 0 / no difference |
| Changed files / default | 0 / comparison completed |
| Changed files / --exit-code | 1 / files differ |
| Changed files / --mode json | Structured JSON returned |
| Missing input file | 2 / an error occurred |
omnidiff --headless --color never before.py after.py omnidiff --headless --exit-code before.py after.py omnidiff --mode json before.py after.py
These commands assume OmniDiff is installed and the two files are in the current folder. --headless prints the result as text; --color never removes color codes. --exit-code makes a difference return 1. --mode json gives a program-readable result. We checked version 0.4.0 and verified its release hash. [7] [9]