|
|
@ -128,7 +128,9 @@ macro_rules! runnable_for_tuple { |
|
|
|
#[allow(unused)]
|
|
|
|
fn run<_R: SymbolRunner>(&self, runner: &_R, force: bool) -> Result<bool, Box<dyn Error>> {
|
|
|
|
let ($($name,)*) = self;
|
|
|
|
Ok($(runner.run_symbol($name, force)? || )* false)
|
|
|
|
let mut result = false;
|
|
|
|
$(result = runner.run_symbol($name, force)? || result;)*
|
|
|
|
Ok(result)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
@ -342,4 +344,23 @@ mod test { |
|
|
|
setup.add(TestResource("A", "B")).unwrap();
|
|
|
|
assert_eq!(*count.borrow(), 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn correctly_handles_symbol_tuples() {
|
|
|
|
let (count, setup) = get_setup();
|
|
|
|
setup.run_symbol((TestSymbol { reached: false }, TestSymbol { reached: false }), false).unwrap();
|
|
|
|
assert_eq!(*count.borrow(), 2);
|
|
|
|
|
|
|
|
let (count, setup) = get_setup();
|
|
|
|
setup.run_symbol((TestSymbol { reached: true }, TestSymbol { reached: false }), false).unwrap();
|
|
|
|
assert_eq!(*count.borrow(), 1);
|
|
|
|
|
|
|
|
let (count, setup) = get_setup();
|
|
|
|
setup.run_symbol((TestSymbol { reached: false }, TestSymbol { reached: true }), false).unwrap();
|
|
|
|
assert_eq!(*count.borrow(), 1);
|
|
|
|
|
|
|
|
let (count, setup) = get_setup();
|
|
|
|
setup.run_symbol((TestSymbol { reached: true }, TestSymbol { reached: true }), true).unwrap();
|
|
|
|
assert_eq!(*count.borrow(), 2);
|
|
|
|
}
|
|
|
|
}
|