You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ahh, did I need to run with the gc_tombstone feature? eg. cargo test --features='gc_tombstone'?
Yup, that's it! I usually run cargo make test to get this task because I'm reviewing snapshots. (You can get the cargo make subcommand via cargo-run-bin configured in this repo or from cargo-make itself.)
Those instructions will definitely go in the contributor guide that I've (slowly 😅) been working on. But for now, here's a quick explanation of what's happening:
The snapshots only work as test data if they're deterministic and reproducible. Since objects currently print as their memory locations, I chose to rewrite those IDs into small integers.
But then the garbage collector shows up! The gc_tombstone feature changes the GC to not reuse freed memory. Instead of releasing the memory, it replaces the contents with a special "tombstone" object that panics if it ever gets used. That way, object IDs (memory addresses) never get reused, and we can uniquely identify any object printed in the tests.
I'll leave this open as a reminder to at least one of these things:
Make cargo test work without doing anything special
Document "how to run tests" as part of a CONTRIBUTING.md
Saw the following issue on checkout and running
cargo test
.The text was updated successfully, but these errors were encountered: