7B4X77QUU6FEO7YBDMTGJGUDR3EWVORCIUCOZDH76WHZFQ6C2CUAC
use super::*;
#[test]
fn anyhow() {
let error1 = anyhow!("This {}", "works");
let error2 = anyhow!("This works");
assert_eq!(error1.to_string(), error2.to_string());
}
#[test]
fn bail() {
let f = || -> Result<()> { bail!("This {}", "works") };
let error1 = f().err().unwrap();
let f = || -> Result<()> { bail!("This works") };
let error2 = f().err().unwrap();
assert_eq!(error1.to_string(), error2.to_string());
}
#[cfg(test)]
mod test {
use super::*;
#[test]
fn anyhow() {
let error1 = anyhow!("This {}", "works");
let error2 = anyhow!("This works");
assert_eq!(error1.to_string(), error2.to_string());
}
#[test]
fn bail() {
let f = || -> Result<()> { bail!("This {}", "works") };
let error1 = f().err().unwrap();
let f = || -> Result<()> { bail!("This works") };
let error2 = f().err().unwrap();
assert_eq!(error1.to_string(), error2.to_string());
}
}