layout/tests: Use existing method
Browse files at this commit06ec9eecdb6d41bc50258cc6b53bf2b4d8c82d56Parent: 79eef5e1 changed file +2 -21
- src/layout/mod.rs +2 -21
src/layout/mod.rsmodified+2 -21
| @@ -3237,27 +3237,8 @@ mod tests { | |||
| 3237 | bbox, | 3237 | bbox, |
| 3238 | min_max_size, | 3238 | min_max_size, |
| 3239 | } => { | 3239 | } => { |
| 3240 | - match &mut layout.monitor_set { | 3240 | + if layout.has_window(&id) { |
| 3241 | - MonitorSet::Normal { monitors, .. } => { | 3241 | + return; |
| 3242 | - for mon in monitors { | ||
| 3243 | - for ws in &mut mon.workspaces { | ||
| 3244 | - for win in ws.windows() { | ||
| 3245 | - if win.0.id == id { | ||
| 3246 | - return; | ||
| 3247 | - } | ||
| 3248 | - } | ||
| 3249 | - } | ||
| 3250 | - } | ||
| 3251 | - } | ||
| 3252 | - MonitorSet::NoOutputs { workspaces, .. } => { | ||
| 3253 | - for ws in workspaces { | ||
| 3254 | - for win in ws.windows() { | ||
| 3255 | - if win.0.id == id { | ||
| 3256 | - return; | ||
| 3257 | - } | ||
| 3258 | - } | ||
| 3259 | - } | ||
| 3260 | - } | ||
| 3261 | } | 3242 | } |
| 3262 | 3243 | ||
| 3263 | let win = TestWindow::new(id, bbox, min_max_size.0, min_max_size.1); | 3244 | let win = TestWindow::new(id, bbox, min_max_size.0, min_max_size.1); |