Update tests

This commit is contained in:
Adrian Heine 2024-11-29 08:21:57 +01:00
parent ff32cda7df
commit 136c348f01
2 changed files with 4 additions and 2 deletions

View file

@ -74,6 +74,7 @@ mod test {
let symbol = User { let symbol = User {
user_name: "nonexisting", user_name: "nonexisting",
command_runner: StdCommandRunner, command_runner: StdCommandRunner,
home_path: "/home/nonexisting",
}; };
assert_eq!(run(symbol.target_reached()).unwrap(), false); assert_eq!(run(symbol.target_reached()).unwrap(), false);
} }
@ -83,6 +84,7 @@ mod test {
let symbol = User { let symbol = User {
user_name: "root", user_name: "root",
command_runner: StdCommandRunner, command_runner: StdCommandRunner,
home_path: "/root",
}; };
assert_eq!(run(symbol.target_reached()).unwrap(), true); assert_eq!(run(symbol.target_reached()).unwrap(), true);
} }

View file

@ -61,7 +61,7 @@ fn test(
#[test] #[test]
fn can_create_an_acme_user() { fn can_create_an_acme_user() {
let mut result = test(1, |setup| { let mut result = test(1, |setup| {
assert_eq!(&*(run(setup.add(AcmeUser)).unwrap().0).0, "acme"); assert_eq!(((run(setup.add(AcmeUser)).unwrap().0).0).0.as_ref(), "acme");
}); });
let entry = result let entry = result
.pop() .pop()
@ -127,7 +127,7 @@ fn can_create_an_acme_cert() {
.pop() .pop()
.expect("log is empty but should contain one entry"); .expect("log is empty but should contain one entry");
assert_eq!(entry.0, 3, "log entry has wrong level"); assert_eq!(entry.0, 3, "log entry has wrong level");
assert_eq!(entry.1.matches("run_symbol").count(), 19); assert_eq!(entry.1.matches("run_symbol").count(), 18);
assert_eq!(result.len(), 0, "log has more than one entry"); assert_eq!(result.len(), 0, "log has more than one entry");
} }