diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-05-18 21:32:40 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-05-18 21:32:40 +0200 |
| commit | 118fc1014bcfc5585fd3ce32348fbfe14bdc05a9 (patch) | |
| tree | 51ef7937188776d0343196fda207c77e732859d1 /tests | |
| parent | 7025590405623b99ec93aa6eddc9fc909e8f83a8 (diff) | |
Leaner argument parsing
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/typeset.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/typeset.rs b/tests/typeset.rs index 1e196446..0d862c81 100644 --- a/tests/typeset.rs +++ b/tests/typeset.rs @@ -321,8 +321,8 @@ fn register_helpers(scope: &mut Scope, panics: Rc<RefCell<Vec<Panic>>>) { } let test = move |ctx: &mut EvalContext, args: &mut FuncArgs| -> Value { - let lhs = args.require::<Value>(ctx, "left-hand side"); - let rhs = args.require::<Value>(ctx, "right-hand side"); + let lhs = args.eat_expect::<Value>(ctx, "left-hand side"); + let rhs = args.eat_expect::<Value>(ctx, "right-hand side"); if lhs != rhs { panics.borrow_mut().push(Panic { pos: args.span.start, lhs, rhs }); Value::Str(format!("(panic)")) |
