diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-03-15 11:30:13 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-03-15 11:30:13 +0100 |
| commit | ae0a56cdffa515ed6bb7cb566c025cc66ff00f33 (patch) | |
| tree | 586f4b12af74c7fc29e34960bab004b39425195c /tests | |
| parent | 6f5b721fe56fe6e3735d03b07e3716fc39572639 (diff) | |
Non-returning error macro
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/typeset.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/tests/typeset.rs b/tests/typeset.rs index dfc8bff9..5e9b79fe 100644 --- a/tests/typeset.rs +++ b/tests/typeset.rs @@ -18,7 +18,7 @@ use typst::loading::FsLoader; use typst::parse::Scanner; use typst::source::SourceFile; use typst::syntax::Span; -use typst::Context; +use typst::{bail, Context}; const TYP_DIR: &str = "./typ"; const REF_DIR: &str = "./ref"; @@ -77,10 +77,7 @@ fn main() { let lhs = args.expect::<Value>("left-hand side")?; let rhs = args.expect::<Value>("right-hand side")?; if lhs != rhs { - return Err(Error::boxed( - args.span, - format!("Assertion failed: {:?} != {:?}", lhs, rhs), - )); + bail!(args.span, "Assertion failed: {:?} != {:?}", lhs, rhs,); } Ok(Value::None) }); |
