forked from softdevteam/grmtools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_utils.rs
More file actions
25 lines (24 loc) · 768 Bytes
/
test_utils.rs
File metadata and controls
25 lines (24 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#[allow(unused)]
pub use crate::header::{Header, Value};
pub use crate::markmap::{Entry, MergeBehavior};
pub use crate::Location;
#[macro_export]
#[cfg(test)]
macro_rules! header_for_yacckind {
($yk:expr) => {{
let mut header = Header::new();
match header.entry("yacckind".to_string()) {
Entry::Occupied(_) => unreachable!("Header should be empty"),
Entry::Vacant(v) => {
let mut o = v.insert_entry((
Location::Other("Testsuite".to_string()),
Value::try_from($yk).unwrap(),
));
o.mark_required();
o.set_merge_behavior(MergeBehavior::Ours);
}
};
header
}};
}
pub use header_for_yacckind;