Pin async function evaluation in expressions and reduce trc::Result size
This commit is contained in:
@@ -372,7 +372,7 @@ pub async fn jmap_tests() {
|
||||
.await;
|
||||
|
||||
webhooks::test(&mut params).await;
|
||||
/*email_query::test(&mut params, delete).await;
|
||||
email_query::test(&mut params, delete).await;
|
||||
email_get::test(&mut params).await;
|
||||
email_set::test(&mut params).await;
|
||||
email_parse::test(&mut params).await;
|
||||
@@ -385,7 +385,7 @@ pub async fn jmap_tests() {
|
||||
mailbox::test(&mut params).await;
|
||||
delivery::test(&mut params).await;
|
||||
auth_acl::test(&mut params).await;
|
||||
auth_limits::test(&mut params).await;*/
|
||||
auth_limits::test(&mut params).await;
|
||||
auth_oauth::test(&mut params).await;
|
||||
event_source::test(&mut params).await;
|
||||
push_subscription::test(&mut params).await;
|
||||
|
||||
@@ -426,15 +426,18 @@ async fn eval_if() {
|
||||
//println!("============= Testing {:?} ==================", key);
|
||||
let (_, expected_result) = key.rsplit_once('-').unwrap();
|
||||
assert_eq!(
|
||||
IfBlock {
|
||||
key: key.to_string(),
|
||||
if_then: vec![IfThen {
|
||||
expr: Expression::try_parse(&mut config, key.as_str(), &token_map).unwrap(),
|
||||
then: Expression::from(true),
|
||||
}],
|
||||
default: Expression::from(false),
|
||||
}
|
||||
.eval(&envelope, &core, 0)
|
||||
core.eval_if::<Variable, _>(
|
||||
&IfBlock {
|
||||
key: key.to_string(),
|
||||
if_then: vec![IfThen {
|
||||
expr: Expression::try_parse(&mut config, key.as_str(), &token_map).unwrap(),
|
||||
then: Expression::from(true),
|
||||
}],
|
||||
default: Expression::from(false),
|
||||
},
|
||||
&envelope,
|
||||
0
|
||||
)
|
||||
.await
|
||||
.unwrap()
|
||||
.to_bool(),
|
||||
@@ -485,7 +488,7 @@ async fn eval_dynvalue() {
|
||||
.unwrap_or_else(|| panic!("Missing expect for test {test_name:?}"));
|
||||
|
||||
assert_eq!(
|
||||
String::try_from(if_block.eval(&envelope, &core, 0).await.unwrap()).ok(),
|
||||
core.eval_if::<String, _>(&if_block, &envelope, 0).await,
|
||||
expected,
|
||||
"failed for test {test_name:?}"
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user