mirror of
https://github.com/YGGverse/ggemini.git
synced 2026-03-31 17:15:31 +00:00
21 lines
703 B
Rust
21 lines
703 B
Rust
use glib::{Uri, UriFlags};
|
|
|
|
#[test]
|
|
fn single_socket_request_async() {
|
|
// Parse URI
|
|
match Uri::parse("gemini://geminiprotocol.net/", UriFlags::NONE) {
|
|
// Begin async request
|
|
Ok(uri) => ggemini::client::single_socket_request_async(uri, |result| match result {
|
|
// Process response
|
|
Ok(response) => {
|
|
// Expect success status
|
|
assert!(match response.header().status() {
|
|
Some(ggemini::client::response::header::Status::Success) => true,
|
|
_ => false,
|
|
})
|
|
}
|
|
Err(_) => assert!(false),
|
|
}),
|
|
Err(_) => assert!(false),
|
|
}
|
|
} // @TODO async
|