We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9cda0f3 commit 4e6015aCopy full SHA for 4e6015a
datafusion/optimizer/src/test/mod.rs
@@ -135,6 +135,19 @@ fn observe(_plan: &LogicalPlan, _rule: &dyn OptimizerRule) {}
135
136
#[macro_export]
137
macro_rules! assert_optimized_plan_eq_snapshot {
138
+ (
139
+ $optimizer_context:expr,
140
+ $rules:expr,
141
+ $plan:expr,
142
+ @ $expected:literal $(,)?
143
+ ) => {{
144
+ let optimizer = $crate::Optimizer::with_rules($rules);
145
+ let optimized_plan = optimizer.optimize($plan, &$optimizer_context, |_, _| {})?;
146
+ insta::assert_snapshot!(optimized_plan, @ $expected);
147
+
148
+ Ok::<(), datafusion_common::DataFusionError>(())
149
+ }};
150
151
(
152
$rule:expr,
153
$plan:expr,
0 commit comments