mirror of https://github.com/dnaka91/obws
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
572 B
Rust
29 lines
572 B
Rust
use anyhow::Result;
|
|
use obws::events::Event;
|
|
use serde::Serialize;
|
|
|
|
use crate::{common, wait_for};
|
|
|
|
#[tokio::test]
|
|
async fn general() -> Result<()> {
|
|
let client = common::new_client().await?;
|
|
let events = client.events()?;
|
|
let client = client.general();
|
|
|
|
tokio::pin!(events);
|
|
|
|
client.version().await?;
|
|
client
|
|
.broadcast_custom_event(&CustomEvent { hello: "world!" })
|
|
.await?;
|
|
wait_for!(events, Event::CustomEvent(_));
|
|
client.stats().await?;
|
|
|
|
Ok(())
|
|
}
|
|
|
|
#[derive(Serialize)]
|
|
struct CustomEvent<'a> {
|
|
hello: &'a str,
|
|
}
|