Assert edges, source and target nodes, tests

This commit is contained in:
elvis
2025-08-14 02:47:12 +02:00
parent 3af6ce5130
commit cd00567978
4 changed files with 1594 additions and 132 deletions

File diff suppressed because it is too large Load Diff

View File

@ -49,8 +49,8 @@ match {
"UncommonEntitiesDeleted", "UncommonMaskEntitiesDeleted",
"EntitiesAdded", "MaskEntitiesAdded",
"UncommonEntitiesAdded", "UncommonMaskEntitiesAdded",
"label", "if", "then", "else", "let", "=", "return", "for", "in",
"not", "rand", ".empty", ".length", ".tostr",
"label", "edge", "if", "then", "else", "let", "=", "return", "for", "in",
"not", "rand", ".empty", ".length", ".tostr", ".source", ".target",
"&&", "||", "^^", "<=", ">=", "==", "!=", "+", "*", "/", "%",
"::", "substr", "min", "max", "commonsubstr",
"AvailableEntities", "AllReactants", "AllInhibitors",
@ -217,6 +217,7 @@ AssertAssignmentVar: assert::AssignmentVariable = {
AssertVariable: assert::Variable = {
"label" => assert::Variable::Label,
"edge" => assert::Variable::Edge,
<v: Literal> => assert::Variable::Id(v),
}
@ -262,6 +263,9 @@ AssertUnarySuffix: assert::Unary = {
".length" => assert::Unary::Length,
".tostr" => assert::Unary::ToStr,
".toel" => assert::Unary::ToEl,
".source" => assert::Unary::Source,
".target" => assert::Unary::Target,
".neighbours" => assert::Unary::Neighbours,
"." <q: AssertQualifier> => assert::Unary::Qualifier(q),
}

View File

@ -81,17 +81,13 @@ fn filter_delta<'a>(x: (&IdType, &'a RSprocess)) -> Option<&'a RSset> {
use super::structure::RSprocess::*;
let (id, rest) = x;
if let EntitySet {
entities,
next_process,
} = rest
if let EntitySet { entities, next_process } = rest
&& let RecursiveIdentifier { identifier } = &**next_process
&& identifier == id
{
if let RecursiveIdentifier { identifier } = &**next_process {
if identifier == id {
return Some(entities);
}
}
return Some(entities);
}
None
}
@ -196,16 +192,11 @@ fn filter_delta_named<'a>(
return None;
}
if let EntitySet {
entities,
next_process,
} = rest
if let EntitySet { entities, next_process } = rest
&& let RecursiveIdentifier { identifier } = &**next_process
&& identifier == id
{
if let RecursiveIdentifier { identifier } = &**next_process {
if identifier == id {
return Some(entities);
}
}
return Some(entities);
}
None
}