tor_config/
testing.rs

1//! Helpers for testing configuration.
2
3/// Assert that the specified error is the specified `kind` of
4/// [`ConfigBuildError`](crate::ConfigBuildError).
5#[macro_export]
6macro_rules! assert_config_error {
7    ($err:expr, $kind:tt, $expect_problem:expr) => {
8        match $err {
9            $crate::ConfigBuildError::$kind { problem, .. } => {
10                assert_eq!(problem, $expect_problem);
11            }
12            _ => {
13                panic!("unexpected error {:?}", $err);
14            }
15        }
16    };
17}