mirror of
https://github.com/gorules/zen.git
synced 2026-10-04 08:02:28 +00:00
fix: fmt
This commit is contained in:
@@ -455,12 +455,15 @@ impl DecisionTableIr {
|
||||
let Some(cell) = rule.get(&col.id).filter(|c| !c.is_empty()) else {
|
||||
continue;
|
||||
};
|
||||
let cell_target = rule.get(ROW_ID_KEY).map(|row| CursorTarget::DecisionTableCell {
|
||||
row: row.clone(),
|
||||
col: col.id.clone(),
|
||||
let cell_target = rule
|
||||
.get(ROW_ID_KEY)
|
||||
.map(|row| CursorTarget::DecisionTableCell {
|
||||
row: row.clone(),
|
||||
col: col.id.clone(),
|
||||
});
|
||||
let analysis = cx.with_target(cell_target, |cx| {
|
||||
cx.analyze_standard(cell, Some(col.id.clone()))
|
||||
});
|
||||
let analysis =
|
||||
cx.with_target(cell_target, |cx| cx.analyze_standard(cell, Some(col.id.clone())));
|
||||
match &declared {
|
||||
Some(expected) => {
|
||||
let actual = &analysis.return_type;
|
||||
|
||||
@@ -18,11 +18,11 @@ pub use crate::workspace::{
|
||||
DiagnosticLocation, Dictionary, DictionaryEntryInfo, DiscriminantVariant, DiscriminatedUnion,
|
||||
EngineEdit, Entity, EntityField, EvaluateRequest, EvaluationError, EvaluationResult,
|
||||
ExpressionFacts, ExpressionKind, FieldOrigin, FunctionResolutionRequest, FunctionTypeResolver,
|
||||
GraphAnalysis,
|
||||
GraphNodeAnalysis, GraphSignature, GraphTraceMap, GuardedProperty, InputProperty,
|
||||
InputValidationError, InspectResult, NlExpression, OutputProperty, PrepareRename, PropertyKind,
|
||||
ReferenceKind, ReferenceSite, RenameTarget, SchemaFieldKind, SchemaGroup, ScopeRequest,
|
||||
Severity, SlotResponse, SlotRole, Span, Trace, Workspace, WriteConflict, WriteTrace,
|
||||
GraphAnalysis, GraphNodeAnalysis, GraphSignature, GraphTraceMap, GuardedProperty,
|
||||
InputProperty, InputValidationError, InspectResult, NlExpression, OutputProperty,
|
||||
PrepareRename, PropertyKind, ReferenceKind, ReferenceSite, RenameTarget, SchemaFieldKind,
|
||||
SchemaGroup, ScopeRequest, Severity, SlotResponse, SlotRole, Span, Trace, Workspace,
|
||||
WriteConflict, WriteTrace,
|
||||
};
|
||||
pub use raw::{BlockDoc, PolicyDocument};
|
||||
|
||||
|
||||
@@ -14,11 +14,11 @@ use db::Db;
|
||||
use zen_expression::nl::NlResult;
|
||||
use zen_expression::variable::VariableType;
|
||||
|
||||
pub use slot::{CursorScope, ExpressionFacts, SlotResponse};
|
||||
pub use graph::{
|
||||
FunctionResolutionRequest, FunctionTypeResolver, GraphAnalysis, GraphNodeAnalysis,
|
||||
GraphSignature, GraphTraceMap,
|
||||
};
|
||||
pub use slot::{CursorScope, ExpressionFacts, SlotResponse};
|
||||
pub use types::{
|
||||
BlockExecution, BlockRef, BlockTrace, Completion, ConditionTrace, ConditionalSchema, Cursor,
|
||||
CursorTarget, DecisionTableExtras, DependencyNode, Diagnostic, DiagnosticCode,
|
||||
|
||||
@@ -812,7 +812,10 @@ fn facts_cover_every_assertion_condition_with_exact_source() {
|
||||
]
|
||||
});
|
||||
let mut ws = PolicyWorkspace::new();
|
||||
ws.set_policy("policy", serde_json::from_value(doc).expect("valid policy fixture"));
|
||||
ws.set_policy(
|
||||
"policy",
|
||||
serde_json::from_value(doc).expect("valid policy fixture"),
|
||||
);
|
||||
let facts = ws.facts("policy");
|
||||
let find = |id: &str| {
|
||||
facts
|
||||
|
||||
@@ -1085,7 +1085,10 @@ fn anonymous_enum_table_has_no_name() {
|
||||
fn const_literal_has_anonymous_table() {
|
||||
let scope = "{\"Object\":{\"something\":{\"Const\":\"hello\"}}}";
|
||||
let (facts, enums) = run("something == \"hello\"", false, scope, "bool");
|
||||
assert_eq!(facts, vec!["enum@13..20 hello valid #0 hello -".to_string()]);
|
||||
assert_eq!(
|
||||
facts,
|
||||
vec!["enum@13..20 hello valid #0 hello -".to_string()]
|
||||
);
|
||||
assert_eq!(enums.len(), 1);
|
||||
assert_eq!(enums[0].name, None);
|
||||
assert_eq!(enums[0].options.len(), 1);
|
||||
@@ -1094,7 +1097,10 @@ fn const_literal_has_anonymous_table() {
|
||||
assert_eq!(enums[0].options[0].source.as_deref(), Some("\"hello\""));
|
||||
|
||||
let (facts, enums) = run("something == \"helloo\"", false, scope, "bool");
|
||||
assert_eq!(facts, vec!["enum@13..21 helloo invalid #0 helloo -".to_string()]);
|
||||
assert_eq!(
|
||||
facts,
|
||||
vec!["enum@13..21 helloo invalid #0 helloo -".to_string()]
|
||||
);
|
||||
assert_eq!(enums.len(), 1);
|
||||
assert_eq!(enums[0].options[0].value, "hello");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user