mirror of
https://github.com/zaphar/ucg.git
synced 2025-07-22 18:19:54 -04:00
FEATURE: output the parse or build errors of assert statements.
This commit is contained in:
parent
0003e1b9c3
commit
d288924fbb
@ -991,11 +991,15 @@ impl<'a> Builder<'a> {
|
||||
let ok = match self.eval_string(&expr_as_stmt) {
|
||||
Ok(v) => v,
|
||||
Err(e) => {
|
||||
return Err(Box::new(error::Error::new(
|
||||
format!("Assertion Evaluation of [{}] failed: {}", expr, e),
|
||||
error::ErrorType::AssertError,
|
||||
tok.pos.clone(),
|
||||
)));
|
||||
// failure!
|
||||
let msg = format!(
|
||||
"NOT OK - '{}' at line: {} column: {}\n\tCompileError: {}\n",
|
||||
expr, tok.pos.line, tok.pos.column, e
|
||||
);
|
||||
self.assert_collector.summary.push_str(&msg);
|
||||
self.assert_collector.failures.push_str(&msg);
|
||||
self.assert_collector.success = false;
|
||||
return Ok(Rc::new(Val::Empty));
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user