Extract check_ops
Browse files at this commit5ad5f29a923d09b812cb0d08524a3049786fda55Parent: 756997c1 changed file +10 -5
- src/layout.rs +10 -5
src/layout.rsmodified+10 -5
| @@ -2514,6 +2514,15 @@ mod tests { | |||
| 2514 | } | 2514 | } |
| 2515 | } | 2515 | } |
| 2516 | 2516 | ||
| 2517 | + #[track_caller] | ||
| 2518 | + fn check_ops(ops: &[Op]) { | ||
| 2519 | + let mut monitor_set = MonitorSet::default(); | ||
| 2520 | + for op in ops { | ||
| 2521 | + op.apply(&mut monitor_set); | ||
| 2522 | + monitor_set.verify_invariants(); | ||
| 2523 | + } | ||
| 2524 | + } | ||
| 2525 | + | ||
| 2517 | #[test] | 2526 | #[test] |
| 2518 | fn operations() { | 2527 | fn operations() { |
| 2519 | let every_op = [ | 2528 | let every_op = [ |
| @@ -2601,10 +2610,6 @@ mod tests { | |||
| 2601 | Op::AddOutput(2), | 2610 | Op::AddOutput(2), |
| 2602 | ]; | 2611 | ]; |
| 2603 | 2612 | ||
| 2604 | - let mut monitor_set = MonitorSet::default(); | 2613 | + check_ops(&ops); |
| 2605 | - for op in ops { | ||
| 2606 | - op.apply(&mut monitor_set); | ||
| 2607 | - monitor_set.verify_invariants(); | ||
| 2608 | - } | ||
| 2609 | } | 2614 | } |
| 2610 | } | 2615 | } |