Rework unit test report to leverage new reification
And also provide slightly better errors when traces, or trace-if-false operators are present.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
use crate::ast::{Constant, NamedDeBruijn, Term};
|
||||
|
||||
use super::{cost_model::ExBudget, Error};
|
||||
use crate::ast::{Constant, NamedDeBruijn, Term};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct EvalResult {
|
||||
@@ -44,6 +43,14 @@ impl EvalResult {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::result_unit_err)]
|
||||
pub fn unwrap_constant(self) -> Result<Constant, ()> {
|
||||
match self.result {
|
||||
Ok(Term::Constant(cst)) => Ok(cst.as_ref().to_owned()),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn result(&self) -> Result<Term<NamedDeBruijn>, Error> {
|
||||
self.result.clone()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user