mirror of
https://github.com/zaphar/ucg.git
synced 2025-07-24 18:39:50 -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) {
|
let ok = match self.eval_string(&expr_as_stmt) {
|
||||||
Ok(v) => v,
|
Ok(v) => v,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
return Err(Box::new(error::Error::new(
|
// failure!
|
||||||
format!("Assertion Evaluation of [{}] failed: {}", expr, e),
|
let msg = format!(
|
||||||
error::ErrorType::AssertError,
|
"NOT OK - '{}' at line: {} column: {}\n\tCompileError: {}\n",
|
||||||
tok.pos.clone(),
|
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