scidataflow 0.8.11

A command-line tool to manage scientific research project data.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use anyhow::Result;

pub fn check_error<T>(result: Result<T>, pattern: &str) {
    match result {
        Ok(_) => panic!("Expected an error, but got Ok"),
        Err(err) => {
            assert!(
                err.to_string().contains(pattern),
                "Unexpected error {:?} containing pattern \"{:?}\" ",
                err,
                pattern
            );
        }
    }
}