|
|
@ -348,24 +348,49 @@ mod test { |
|
|
|
#[test]
|
|
|
|
fn correctly_handles_symbol_tuples() {
|
|
|
|
let (count, setup) = get_setup();
|
|
|
|
setup.run_symbol((TestSymbol { reached: false }, TestSymbol { reached: false }), false).unwrap();
|
|
|
|
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();
|
|
|
|
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();
|
|
|
|
setup
|
|
|
|
.run_symbol(
|
|
|
|
(TestSymbol { reached: false }, TestSymbol { reached: true }),
|
|
|
|
false,
|
|
|
|
)
|
|
|
|
.unwrap();
|
|
|
|
assert_eq!(*count.borrow(), 2);
|
|
|
|
|
|
|
|
let (count, setup) = get_setup();
|
|
|
|
setup.run_symbol((TestSymbol { reached: true }, TestSymbol { reached: true }), false).unwrap();
|
|
|
|
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();
|
|
|
|
setup
|
|
|
|
.run_symbol(
|
|
|
|
(TestSymbol { reached: true }, TestSymbol { reached: true }),
|
|
|
|
true,
|
|
|
|
)
|
|
|
|
.unwrap();
|
|
|
|
assert_eq!(*count.borrow(), 2);
|
|
|
|
}
|
|
|
|
}
|