mirror of
https://github.com/tiennm99/miti99.git
synced 2026-09-19 02:23:14 +00:00
Captures the Go engine's stdout for 26 deterministic cases, commits those outputs as fixtures, and asserts the JavaScript engine reproduces them through the real CLI surface, exit codes included. This is both the migration's proof of correctness and the regression net the engine never had. Every fixture was generated from the Go engine rather than written by hand, and reviewed before commit so no existing bug became a permanent contract. Each behaviour that a JavaScript-idiomatic rewrite would silently break has a case that goes red when the naive implementation is reintroduced; verified by mutating the engine and re-running. Content-scanning commands are pointed at a fixture tree through the subprocess working directory. Both engines already resolve content/post from the process CWD, so neither needed a test-only configuration knob, and the suite is proven isolated from the real content by renaming it away and re-running. Cases that depend on live upstreams are opt-in behind NEWSLETTER_NET=1: a publication's feed window moves, and a suite that goes red on someone else's outage teaches people to ignore red. The deterministic tier reaches the network only through .invalid hosts, which never resolve, so it runs offline in about two seconds. The golden files are compared byte for byte, so scripts/newsletter is pinned to LF; the repository otherwise checks out CRLF, which would break every comparison on a fresh clone.
8 lines
211 B
Plaintext
8 lines
211 B
Plaintext
* text=auto eol=crlf
|
|
|
|
*.sh text eol=lf
|
|
|
|
# The newsletter parity suite compares engine stdout to committed golden files
|
|
# byte for byte, so these must stay LF on every checkout.
|
|
scripts/newsletter/** text eol=lf
|