//! Minimal keyring test to isolate the issue

// Suppress false-positive unused_crate_dependencies warnings
// dev-dependencies are shared across ALL test targets in the crate
// This test may not use all deps, but they are required by other integration tests
#![allow(unused_crate_dependencies)]
#![allow(clippy::tests_outside_test_module, clippy::str_to_string, clippy::non_ascii_literal, clippy::shadow_unrelated, clippy::shadow_reuse, clippy::unwrap_used, clippy::expect_used, clippy::assertions_on_result_states, clippy::use_debug, clippy::let_underscore_must_use, clippy::string_add, clippy::string_add_assign, clippy::wildcard_enum_match_arm, clippy::unseparated_literal_suffix, clippy::indexing_slicing, clippy::doc_markdown, clippy::similar_names, clippy::impl_trait_in_params, unused_imports, dead_code, clippy::panic)]

#[tokio::test]
async fn minimal_keyring_test() {
    use anyhow::Result;

    // Direct keyring usage
    let result: Result<()> = tokio::task::spawn_blocking(|| {
        let entry =
            keyring::Entry::new("test-minimal", "test-user").expect("Failed to create entry");

        entry
            .set_password("test-password-123")
            .expect("Failed to set password");

        println!("Password set successfully");

        let retrieved = entry.get_password().expect("Failed to get password");

        println!("Retrieved: {}", retrieved);
        assert_eq!(retrieved, "test-password-123");

        // Cleanup
        let _ = entry.delete_credential();

        Ok(())
    })
    .await
    .expect("Blocking task panicked");

    result.expect("Keyring operations failed");
}
