Guide API
Skip to main content

snapshot

Function snapshot 

Source
pub fn snapshot(buffer: &Buffer, cursor: SnapshotCursor) -> String
Expand description

Render buffer (and the cursor state) to the canonical golden-snapshot string documented on this module.

Pass the result to insta::assert_snapshot!. The output is fully deterministic — same buffer + cursor always yields the same string, with no timestamps or addresses.

§Panics

Panics if the buffer contains more than 63 distinct styles (the 1-char-key legend is exhausted). Real widget tests use a handful of styles; a test that genuinely needs more should be split.