librespot-core 0.2.0

The core functionality provided by librespot
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use librespot_core::authentication::Credentials;
use librespot_core::config::SessionConfig;
use librespot_core::session::Session;

#[tokio::test]
async fn test_connection() {
    let result = Session::connect(
        SessionConfig::default(),
        Credentials::with_password("test", "test"),
        None,
    )
    .await;

    match result {
        Ok(_) => panic!("Authentication succeeded despite of bad credentials."),
        Err(e) => assert_eq!(e.to_string(), "Login failed with reason: Bad credentials"),
    };
}