pub use liblitho::platform::{
current_euid_or_0, elevation_capability, elevation_dialog_lines, elevation_method, is_elevated,
relaunch_elevated, validate_elevation_prerequisites, ElevationCapability,
};
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn elevated_process_reports_capability_ready() {
if is_elevated() {
assert!(elevation_capability().ready);
}
}
#[cfg(target_os = "linux")]
#[test]
fn polkit_ready_implies_pkexec_method() {
let cap = elevation_capability();
if cap.ready && cap.status_label == "polkit ready" {
assert_eq!(elevation_method(), "pkexec");
}
}
#[cfg(target_os = "linux")]
#[test]
fn sudo_ready_implies_sudo_method() {
let cap = elevation_capability();
if cap.ready && cap.status_label == "sudo ready" {
assert_eq!(elevation_method(), "sudo");
}
}
}