facet-styx 4.0.0

Facet integration for the Styx configuration language
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Test utilities for snapshot testing with ANSI-stripped output.

/// Assert a snapshot with ANSI escape codes stripped.
///
/// This macro wraps `insta::assert_snapshot!` but strips ANSI escape codes
/// from the input first, making snapshots readable and diff-friendly.
#[macro_export]
macro_rules! assert_snapshot_stripped {
    ($value:expr) => {{
        let stripped = String::from_utf8(strip_ansi_escapes::strip(&$value)).unwrap();
        insta::assert_snapshot!(stripped);
    }};
    ($name:expr, $value:expr) => {{
        let stripped = String::from_utf8(strip_ansi_escapes::strip(&$value)).unwrap();
        insta::assert_snapshot!($name, stripped);
    }};
}