mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-11-23 07:07:07 +03:00
Enable warnings for failing tests
This commit is contained in:
parent
a909a31dbf
commit
37fe6f5bb1
@ -50,8 +50,9 @@ impl Namespace for CompileNamespace {
|
||||
fn run_test(&self, test: Test) -> Result<Value, String> {
|
||||
let buf = BufferEmitter(Rc::default(), Rc::default());
|
||||
let handler = Handler::new(Box::new(buf.clone()));
|
||||
|
||||
create_session_if_not_set_then(|_| run_test(test, &handler).map_err(|()| buf.0.take().to_string()))
|
||||
create_session_if_not_set_then(|_| {
|
||||
run_test(test, &handler).map_err(|()| buf.0.take().to_string() + &buf.1.take().to_string())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -56,8 +56,9 @@ impl Namespace for ExecuteNamespace {
|
||||
fn run_test(&self, test: Test) -> Result<Value, String> {
|
||||
let buf = BufferEmitter(Rc::default(), Rc::default());
|
||||
let handler = Handler::new(Box::new(buf.clone()));
|
||||
|
||||
create_session_if_not_set_then(|_| run_test(test, &handler, &buf).map_err(|()| buf.0.take().to_string()))
|
||||
create_session_if_not_set_then(|_| {
|
||||
run_test(test, &handler, &buf).map_err(|()| buf.0.take().to_string() + &buf.1.take().to_string())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,9 @@ fn with_handler<T>(
|
||||
) -> Result<T, String> {
|
||||
let (handler, buf) = Handler::new_with_buf();
|
||||
let mut tokens = ParserContext::new(&handler, tokens);
|
||||
let parsed = handler.extend_if_error(logic(&mut tokens)).map_err(|_| buf.extract_errs().to_string())?;
|
||||
let parsed = handler
|
||||
.extend_if_error(logic(&mut tokens))
|
||||
.map_err(|_| buf.extract_errs().to_string() + &buf.extract_warnings().to_string())?;
|
||||
not_fully_consumed(&mut tokens)?;
|
||||
Ok(parsed)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user