plushie/testing/tree_hash
Structural tree hash for regression testing.
Computes a SHA-256 hash of the serialized UI tree and compares against golden files. Works on all backends.
On first run, creates a .sha256 file. On subsequent runs, compares
the current hash against the stored one. Set PLUSHIE_UPDATE_SNAPSHOTS=1
to force-update golden files.
Types
Values
pub fn assert_tree_hash(
tree: node.Node,
name: String,
path: String,
) -> Nil
Assert that a tree hash matches its golden file.
If no golden file exists, creates one (first run). If PLUSHIE_UPDATE_SNAPSHOTS=1 is set, updates the golden file. Otherwise compares hashes and panics on mismatch.