Macro insta::assert_toml_snapshot
source · macro_rules! assert_toml_snapshot { ($value:expr, @$snapshot:literal) => { ... }; ($value:expr, $(match ..)? {$($k:expr => $v:expr),*$(,)?}, @$snapshot:literal) => { ... }; ($value:expr, $(match ..)? {$($k:expr => $v:expr),*$(,)?}) => { ... }; ($name:expr, $value:expr) => { ... }; ($name:expr, $value:expr, $(match ..)? {$($k:expr => $v:expr),*$(,)?}) => { ... }; ($value:expr) => { ... }; }
Available on crate feature
toml
only.Expand description
Asserts a Serialize
snapshot in TOML format.
Feature: toml
(disabled by default)
This works exactly like [assert_yaml_snapshot!
]
but serializes in TOML format instead of
YAML. Note that TOML cannot represent all values due to limitations in the
format.
Example:
insta::assert_toml_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.