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 mod prelude {
pub use crate::{YRes, YError, Trace, err, ctx};
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn err_works() {
let x = 3;
let y = "t";
err!(ParseError).print();
err!(ParseError::"parse A to B").print();
err!(ParseError, x).print();
err!(ParseError::"parse A to B", y).print();
err!(ParseError::"parse A to B": "parse json field F failed").print();
err!(ParseError::"parse A to B": "parse json field F failed", x, y).print();
}
#[test]
fn ctx_works() {
let x = 3;
let y = "t";
println!("{}", ctx!());
println!("{}", ctx!("parse A to B"));
println!("{}", ctx!(x));
println!("{}", ctx!(y));
println!("{}", ctx!(y, x));
println!("{}", ctx!("parse A to B", y));
println!("{}", ctx!("parse A to B": "parse json field F failed"));
println!("{}", ctx!("parse A to B": "parse json field F failed", x, y));
}
}