An unreached symbol forces all further symbols in the tuple
This commit is contained in:
parent
0a4019ea19
commit
10edcd4282
1 changed files with 7 additions and 2 deletions
|
|
@ -129,7 +129,7 @@ macro_rules! runnable_for_tuple {
|
|||
fn run<_R: SymbolRunner>(&self, runner: &_R, force: bool) -> Result<bool, Box<dyn Error>> {
|
||||
let ($($name,)*) = self;
|
||||
let mut result = false;
|
||||
$(result = runner.run_symbol($name, force)? || result;)*
|
||||
$(result = runner.run_symbol($name, force || result)? || result;)*
|
||||
Ok(result)
|
||||
}
|
||||
}
|
||||
|
|
@ -355,9 +355,14 @@ mod test {
|
|||
setup.run_symbol((TestSymbol { reached: true }, TestSymbol { reached: false }), false).unwrap();
|
||||
assert_eq!(*count.borrow(), 1);
|
||||
|
||||
// An unreached symbol forces all further symbols
|
||||
let (count, setup) = get_setup();
|
||||
setup.run_symbol((TestSymbol { reached: false }, TestSymbol { reached: true }), false).unwrap();
|
||||
assert_eq!(*count.borrow(), 1);
|
||||
assert_eq!(*count.borrow(), 2);
|
||||
|
||||
let (count, setup) = get_setup();
|
||||
setup.run_symbol((TestSymbol { reached: true }, TestSymbol { reached: true }), false).unwrap();
|
||||
assert_eq!(*count.borrow(), 0);
|
||||
|
||||
let (count, setup) = get_setup();
|
||||
setup.run_symbol((TestSymbol { reached: true }, TestSymbol { reached: true }), true).unwrap();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue