/// Validates that a command result matches the expected json string
Validates that a command result matches the expected json string
Validates that a command result matches the expected json string
pub fn assert_result(result: &str, expected: &str) {
    let clean_result = cleanup_variable_strings(result);
    let Changeset { diffs, distance, .. } = Changeset::new(&clean_result, expected.trim(), "\n");
    if distance == 0 {
        return;
    }
    for diff in &diffs {
        match diff {
            Difference::Same(ref x) => {
                eprintln!(" {}", x);
            }
            Difference::Add(ref x) => {
                eprintln!("+{}", x);
            }
            Difference::Rem(ref x) => {
                eprintln!("-{}", x);
            }
        }
    }
    assert_eq!(distance, 0);
}
pub fn assert_result ( result : & str , expected : & str ) { let clean_result = cleanup_variable_strings ( result ) ; let Changeset { diffs , distance , .. } = Changeset :: new ( & clean_result , expected . trim ( ) , " \n " ) ; if distance == 0 { return ; } for diff in & diffs { match diff { Difference :: Same ( ref x ) => { eprintln ! ( " " x ) ; } Difference :: Add ( ref x ) => { eprintln ! ( " " x ) ; } Difference :: Rem ( ref x ) => { eprintln ! ( " " x ) ; } } } assert_eq ! ( distance 0 ) ; }
Validates that a command result matches the expected json string
Validates that a command result matches the expected json string
result
&str
expected
&str