mirror of
https://github.com/YGGverse/ggemini.git
synced 2026-03-31 17:15:31 +00:00
draft test
This commit is contained in:
parent
fd96406dae
commit
afc030420b
1 changed files with 21 additions and 0 deletions
21
tests/client.rs
Normal file
21
tests/client.rs
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
use glib::{Uri, UriFlags};
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn simple_socket_request_async() {
|
||||||
|
// Parse URI
|
||||||
|
match Uri::parse("gemini://geminiprotocol.net/", UriFlags::NONE) {
|
||||||
|
// Begin async request
|
||||||
|
Ok(uri) => ggemini::client::simple_socket_request_async(uri, |response| match response {
|
||||||
|
// 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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue