facetimehd_toggle 0.1.1

A FaceTimeHD toggle indicator for Macs running Linux
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use facetimehd_toggle::run_command;

// This is a simple method to test run command function
#[test]
fn test_run_command_success() {
    let result = run_command("echo", &["Hello", "Rust"]);
    assert!(result.is_ok(), "Command should succeed");

    let child = result.unwrap();
    let output = child.wait_with_output().unwrap();
    assert!(output.status.success(), "Command should exit successfully");
}

#[test]
fn test_run_command_failure() {
    let result = run_command("nonexistentcommand", &[]);
    assert!(result.is_err(), "Nonexistent command should fail");
}