pub mod config;
pub mod error;
pub mod expertoptions;
pub mod framework;
pub mod pocketoption;
pub mod reimports;
pub mod traits;
pub mod utils;
pub mod validator;
pub mod stream {
pub use binary_options_tools_core_pre::reimports::*;
pub use binary_options_tools_core_pre::utils::stream::RecieverStream;
pub use binary_options_tools_core_pre::utils::tracing::stream_logs_layer;
}
#[cfg(test)]
mod tests {
use std::time::Duration;
use serde::{Deserialize, Serialize};
use tokio::time::sleep;
use tracing::debug;
use binary_options_tools_macros::{deserialize, serialize, timeout};
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq)]
struct Test {
name: String,
}
#[test]
fn test_deserialize_macro() {
let test = Test {
name: "Test".to_string(),
};
let test_str = serialize!(&test).unwrap();
let test2 = deserialize!(Test, &test_str).unwrap();
assert_eq!(test, test2)
}
struct Tester;
#[tokio::test]
async fn test_timeout_macro() -> anyhow::Result<()> {
let _ = tracing_subscriber::fmt::try_init();
#[timeout(1, tracing(level = "info", skip(_tester)))]
async fn this_is_a_test(_tester: Tester) -> anyhow::Result<()> {
debug!("Test");
sleep(Duration::from_secs(0)).await;
Ok(())
}
this_is_a_test(Tester).await
}
}