Add the insta crate to your dependencies, import it, and wrap your test assertions with insta::assert_snapshot! to automatically generate and compare output snapshots.
use insta::assert_snapshot;
#[test]
fn test_output() {
let output = "Hello, Rust!";
assert_snapshot!(output);
}
Run cargo insta test to execute tests and review new snapshots, then cargo insta review to accept or reject changes.