[go: up one dir, main page]

assert_ron_snapshot

Macro assert_ron_snapshot 

Source
macro_rules! assert_ron_snapshot {
    ($($arg:tt)*) => { ... };
}
Available on crate feature ron only.
Expand description

Asserts a serde::Serialize snapshot in RON format.

Feature: ron (disabled by default)

This works exactly like assert_yaml_snapshot! but serializes in RON format instead of YAML which retains some type information for more accurate comparisons.

Example:

assert_ron_snapshot!(vec![1, 2, 3]);

The third argument to the macro can be an object expression for redaction. It’s in the form { selector => replacement } or match .. { selector => replacement }. For more information about redactions refer to the redactions feature in the guide.

The snapshot name is optional but can be provided as first argument.