Coding style
This commit is contained in:
parent
25ab1ebf97
commit
67b6f90fe0
2 changed files with 31 additions and 6 deletions
35
src/setup.rs
35
src/setup.rs
|
|
@ -348,24 +348,49 @@ mod test {
|
||||||
#[test]
|
#[test]
|
||||||
fn correctly_handles_symbol_tuples() {
|
fn correctly_handles_symbol_tuples() {
|
||||||
let (count, setup) = get_setup();
|
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);
|
assert_eq!(*count.borrow(), 2);
|
||||||
|
|
||||||
let (count, setup) = get_setup();
|
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);
|
assert_eq!(*count.borrow(), 1);
|
||||||
|
|
||||||
// An unreached symbol forces all further symbols
|
// An unreached symbol forces all further symbols
|
||||||
let (count, setup) = get_setup();
|
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);
|
assert_eq!(*count.borrow(), 2);
|
||||||
|
|
||||||
let (count, setup) = get_setup();
|
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);
|
assert_eq!(*count.borrow(), 0);
|
||||||
|
|
||||||
let (count, setup) = get_setup();
|
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);
|
assert_eq!(*count.borrow(), 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ impl<C: CommandRunner, P: AsRef<Path>> Symbol for Key<C, P> {
|
||||||
],
|
],
|
||||||
)?;
|
)?;
|
||||||
// FIXME check bytes
|
// FIXME check bytes
|
||||||
Ok(stdout.ends_with("RSA key ok\n".as_bytes()))
|
Ok(stdout.ends_with(b"RSA key ok\n"))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn execute(&self) -> Result<(), Box<dyn Error>> {
|
fn execute(&self) -> Result<(), Box<dyn Error>> {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue