Browse Source

Coding style

master
Adrian Heine 4 years ago
parent
commit
67b6f90fe0
  1. 35
      src/setup.rs
  2. 2
      src/symbols/tls/key.rs

35
src/setup.rs

@ -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);
}
}

2
src/symbols/tls/key.rs

@ -40,7 +40,7 @@ impl<C: CommandRunner, P: AsRef<Path>> Symbol for Key<C, P> {
],
)?;
// 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>> {

Loading…
Cancel
Save