#[test]
fn no_backend_fails_to_compile() {
    let output = std::process::Command::new("cargo")
        .args(["check", "--no-default-features"])
        .output()
        .expect("failed to run cargo");
    let stderr = String::from_utf8_lossy(&output.stderr);
    assert!(
        !output.status.success(),
        "expected compilation to fail with no backend selected"
    );
    assert!(
        stderr.contains("exactly one runtime feature must be enabled"),
        "expected feature guard error message, got:\n{stderr}"
    );
}

#[test]
fn multiple_backends_fails_to_compile() {
    let output = std::process::Command::new("cargo")
        .args([
            "check",
            "--no-default-features",
            "--features",
            "rt-tokio,rt-async-std",
        ])
        .output()
        .expect("failed to run cargo");
    let stderr = String::from_utf8_lossy(&output.stderr);
    assert!(
        !output.status.success(),
        "expected compilation to fail with multiple backends selected"
    );
    assert!(
        stderr.contains("exactly one runtime feature must be enabled"),
        "expected feature guard error message, got:\n{stderr}"
    );
}
