Files
Thomas Weber 8ce06bc6a8 Import most of the forkphorus test suite (#303)
forkphorus has its own test suite, most of which are regression tests for real bugs in a real compiler so it may be worth testing against.

forkphorus-befunge-eratosthenes and forkphorus-string-functions are probably the most meaningful new test cases; at the very least i wouldn't have needed a new test case in #300 to see changes in snapshots if they were merged

The tests also add coverage for specializations like "delete 1 of list" that somehow weren't in the suite before?
2026-10-18 14:49:20 -05:00
..
2024-06-17 10:37:37 +10:00
2022-12-06 20:55:58 -06:00

Snapshot tests

Snapshot testing runs the compiler on many of the test projects in test/fixtures/execute and verifies that the compiled output is identical to a pre-calculated "snapshot". This verifies:

  • The compiler is deterministic (mostly)
  • The compiler's output does not change unexpectedly
  • Optimizations and type analysis in the generated code are working properly

These snapshots are automatically verified as part of the integration tests. There is also a more readable CLI for humans. To verify the snapshots:

node test/snapshot

When the compiler's output or the test projects have intentionally changed, run:

node test/snapshot --update

Verify that the snapshot diff is what you expect, then commit the changes.