#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
mod error;
mod ytime;
mod yuid;
mod func;
mod page;
mod ybytes;
pub use error::*;
pub use ytime::YTime;
pub use yuid::YUid;
pub use func::*;
pub use page::Page;
pub use ybytes::YBytes;
pub use yfunc_rust_macro::yfunc;
pub mod prelude {
pub use crate::{yfunc, YRes, YError, Trace, err, ctx, INTERNAL_ERROR};
pub use log::{debug, trace, info, warn, error};
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn err_works() {
let x = 3;
let y = "test";
println!("{:?}", err!());
println!("{:?}", err!("something failed"));
println!("{:?}", err!("something failed, x={}", 3));
println!("{:?}", err!("SOME_ERROR": "something failed"));
println!("{:?}", err!("SOME_ERROR": "something failed, x={}, y={}", x, y));
}
#[test]
fn ctx_works() {
let x = 3;
let y = "test";
println!("{}", ctx!());
println!("{}", ctx!("A -> B -> C"));
println!("{}", ctx!(x));
println!("{}", ctx!(y));
println!("{}", ctx!(y, x));
println!("{}", ctx!("A -> B -> C: D", x, y));
}
#[test]
fn unique_works() {
let list = vec!["123", "345", "123", "222"];
println!("{:?}", list.unique())
}
}