mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-12-06 14:40:08 +08:00
test(service): assert uninstall outcomes without explicit panic
This commit is contained in:
@@ -869,12 +869,18 @@ mod tests {
|
||||
.and_then(|failed| steps.iter().position(|step| *step == failed).map(|index| index + 1))
|
||||
.unwrap_or(steps.len());
|
||||
assert_eq!(&*calls.lock(), &steps[..expected_len]);
|
||||
match (fail_at, result) {
|
||||
(None, Ok(()))
|
||||
| (Some("uninstall"), Err(super::UninstallFailure::Maintenance(_)))
|
||||
| (Some("prepare-sidecar" | "start-sidecar"), Err(super::UninstallFailure::Sidecar(_))) => {}
|
||||
_ => panic!("wrong uninstall outcome for {fail_at:?}"),
|
||||
}
|
||||
assert!(
|
||||
matches!(
|
||||
(fail_at, result),
|
||||
(None, Ok(()))
|
||||
| (Some("uninstall"), Err(super::UninstallFailure::Maintenance(_)))
|
||||
| (
|
||||
Some("prepare-sidecar" | "start-sidecar"),
|
||||
Err(super::UninstallFailure::Sidecar(_))
|
||||
)
|
||||
),
|
||||
"wrong uninstall outcome for {fail_at:?}"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user