forge
Explore
Log in

Don't you dare go Hollow

layout/tests: Make Op non-Copy

Browse files at this commit

8df6231cc164396e19a892f11beb8c02e2e88efbIvan MolodetskikhParent: e837e39
src/layout/tests.rsmodified+81 -77
@@ -396,7 +396,7 @@ fn arbitrary_column_display() -> impl Strategy<Value = ColumnDisplay> {
396 prop_oneof![Just(ColumnDisplay::Normal), Just(ColumnDisplay::Tabbed)]396 prop_oneof![Just(ColumnDisplay::Normal), Just(ColumnDisplay::Tabbed)]
397 }397 }
398 398
399-#[derive(Debug, Clone, Copy, Arbitrary)]399+#[derive(Debug, Clone, Arbitrary)]
400 enum Op {400 enum Op {
401 AddOutput(#[proptest(strategy = "1..=5usize")] usize),401 AddOutput(#[proptest(strategy = "1..=5usize")] usize),
402 AddScaledOutput {402 AddScaledOutput {
@@ -1549,7 +1549,7 @@ impl Op {
1549 }1549 }
1550 1550
1551 #[track_caller]1551 #[track_caller]
1552-fn check_ops_on_layout(layout: &mut Layout<TestWindow>, ops: &[Op]) {1552+fn check_ops_on_layout(layout: &mut Layout<TestWindow>, ops: impl IntoIterator<Item = Op>) {
1553 for op in ops {1553 for op in ops {
1554 op.apply(layout);1554 op.apply(layout);
1555 layout.verify_invariants();1555 layout.verify_invariants();
@@ -1557,14 +1557,17 @@ fn check_ops_on_layout(layout: &mut Layout<TestWindow>, ops: &[Op]) {
1557 }1557 }
1558 1558
1559 #[track_caller]1559 #[track_caller]
1560-fn check_ops(ops: &[Op]) -> Layout<TestWindow> {1560+fn check_ops(ops: impl IntoIterator<Item = Op>) -> Layout<TestWindow> {
1561 let mut layout = Layout::default();1561 let mut layout = Layout::default();
1562 check_ops_on_layout(&mut layout, ops);1562 check_ops_on_layout(&mut layout, ops);
1563 layout1563 layout
1564 }1564 }
1565 1565
1566 #[track_caller]1566 #[track_caller]
1567-fn check_ops_with_options(options: Options, ops: &[Op]) -> Layout<TestWindow> {1567+fn check_ops_with_options(
1568+ options: Options,
1569+ ops: impl IntoIterator<Item = Op>,
1570+) -> Layout<TestWindow> {
1568 let mut layout = Layout::with_options(Clock::with_time(Duration::ZERO), options);1571 let mut layout = Layout::with_options(Clock::with_time(Duration::ZERO), options);
1569 check_ops_on_layout(&mut layout, ops);1572 check_ops_on_layout(&mut layout, ops);
1570 layout1573 layout
@@ -1663,17 +1666,17 @@ fn operations_dont_panic() {
1663 Op::ToggleColumnTabbedDisplay,1666 Op::ToggleColumnTabbedDisplay,
1664 ];1667 ];
1665 1668
1666- for third in every_op {1669+ for third in &every_op {
1667- for second in every_op {1670+ for second in &every_op {
1668- for first in every_op {1671+ for first in &every_op {
1669 // eprintln!("{first:?}, {second:?}, {third:?}");1672 // eprintln!("{first:?}, {second:?}, {third:?}");
1670 1673
1671 let mut layout = Layout::default();1674 let mut layout = Layout::default();
1672- first.apply(&mut layout);1675+ first.clone().apply(&mut layout);
1673 layout.verify_invariants();1676 layout.verify_invariants();
1674- second.apply(&mut layout);1677+ second.clone().apply(&mut layout);
1675 layout.verify_invariants();1678 layout.verify_invariants();
1676- third.apply(&mut layout);1679+ third.clone().apply(&mut layout);
1677 layout.verify_invariants();1680 layout.verify_invariants();
1678 }1681 }
1679 }1682 }
@@ -1838,21 +1841,22 @@ fn operations_from_starting_state_dont_panic() {
1838 Op::ToggleColumnTabbedDisplay,1841 Op::ToggleColumnTabbedDisplay,
1839 ];1842 ];
1840 1843
1841- for third in every_op {1844+ for third in &every_op {
1842- for second in every_op {1845+ for second in &every_op {
1843- for first in every_op {1846+ for first in &every_op {
1844 // eprintln!("{first:?}, {second:?}, {third:?}");1847 // eprintln!("{first:?}, {second:?}, {third:?}");
1845 1848
1846 let mut layout = Layout::default();1849 let mut layout = Layout::default();
1847- for op in setup_ops {1850+ for op in &setup_ops {
1848- op.apply(&mut layout);1851+ op.clone().apply(&mut layout);
1849 }1852 }
1850 1853
1851- first.apply(&mut layout);1854+ let mut layout = Layout::default();
1855+ first.clone().apply(&mut layout);
1852 layout.verify_invariants();1856 layout.verify_invariants();
1853- second.apply(&mut layout);1857+ second.clone().apply(&mut layout);
1854 layout.verify_invariants();1858 layout.verify_invariants();
1855- third.apply(&mut layout);1859+ third.clone().apply(&mut layout);
1856 layout.verify_invariants();1860 layout.verify_invariants();
1857 }1861 }
1858 }1862 }
@@ -1877,7 +1881,7 @@ fn primary_active_workspace_idx_not_updated_on_output_add() {
1877 Op::AddOutput(2),1881 Op::AddOutput(2),
1878 ];1882 ];
1879 1883
1880- check_ops(&ops);1884+ check_ops(ops);
1881 }1885 }
1882 1886
1883 #[test]1887 #[test]
@@ -1891,7 +1895,7 @@ fn window_closed_on_previous_workspace() {
1891 Op::CloseWindow(0),1895 Op::CloseWindow(0),
1892 ];1896 ];
1893 1897
1894- check_ops(&ops);1898+ check_ops(ops);
1895 }1899 }
1896 1900
1897 #[test]1901 #[test]
@@ -1905,7 +1909,7 @@ fn removing_output_must_keep_empty_focus_on_primary() {
1905 Op::RemoveOutput(1),1909 Op::RemoveOutput(1),
1906 ];1910 ];
1907 1911
1908- let layout = check_ops(&ops);1912+ let layout = check_ops(ops);
1909 1913
1910 let MonitorSet::Normal { monitors, .. } = layout.monitor_set else {1914 let MonitorSet::Normal { monitors, .. } = layout.monitor_set else {
1911 unreachable!()1915 unreachable!()
@@ -1935,7 +1939,7 @@ fn move_to_workspace_by_idx_does_not_leave_empty_workspaces() {
1935 },1939 },
1936 ];1940 ];
1937 1941
1938- let layout = check_ops(&ops);1942+ let layout = check_ops(ops);
1939 1943
1940 let MonitorSet::Normal { monitors, .. } = layout.monitor_set else {1944 let MonitorSet::Normal { monitors, .. } = layout.monitor_set else {
1941 unreachable!()1945 unreachable!()
@@ -1962,7 +1966,7 @@ fn empty_workspaces_dont_move_back_to_original_output() {
1962 Op::AddOutput(1),1966 Op::AddOutput(1),
1963 ];1967 ];
1964 1968
1965- check_ops(&ops);1969+ check_ops(ops);
1966 }1970 }
1967 1971
1968 #[test]1972 #[test]
@@ -1985,7 +1989,7 @@ fn named_workspaces_dont_update_original_output_on_adding_window() {
1985 Op::AddOutput(1),1989 Op::AddOutput(1),
1986 ];1990 ];
1987 1991
1988- let layout = check_ops(&ops);1992+ let layout = check_ops(ops);
1989 let (mon, _, ws) = layout1993 let (mon, _, ws) = layout
1990 .workspaces()1994 .workspaces()
1991 .find(|(_, _, ws)| ws.name().is_some())1995 .find(|(_, _, ws)| ws.name().is_some())
@@ -2010,7 +2014,7 @@ fn workspaces_update_original_output_on_moving_to_same_output() {
2010 Op::AddOutput(1),2014 Op::AddOutput(1),
2011 ];2015 ];
2012 2016
2013- let layout = check_ops(&ops);2017+ let layout = check_ops(ops);
2014 let (mon, _, ws) = layout2018 let (mon, _, ws) = layout
2015 .workspaces()2019 .workspaces()
2016 .find(|(_, _, ws)| ws.name().is_some())2020 .find(|(_, _, ws)| ws.name().is_some())
@@ -2038,7 +2042,7 @@ fn workspaces_update_original_output_on_moving_to_same_monitor() {
2038 Op::AddOutput(1),2042 Op::AddOutput(1),
2039 ];2043 ];
2040 2044
2041- let layout = check_ops(&ops);2045+ let layout = check_ops(ops);
2042 let (mon, _, ws) = layout2046 let (mon, _, ws) = layout
2043 .workspaces()2047 .workspaces()
2044 .find(|(_, _, ws)| ws.name().is_some())2048 .find(|(_, _, ws)| ws.name().is_some())
@@ -2065,7 +2069,7 @@ fn large_negative_height_change() {
2065 options.border.off = false;2069 options.border.off = false;
2066 options.border.width = FloatOrInt(1.);2070 options.border.width = FloatOrInt(1.);
2067 2071
2068- check_ops_with_options(options, &ops);2072+ check_ops_with_options(options, ops);
2069 }2073 }
2070 2074
2071 #[test]2075 #[test]
@@ -2084,7 +2088,7 @@ fn large_max_size() {
2084 options.border.off = false;2088 options.border.off = false;
2085 options.border.width = FloatOrInt(1.);2089 options.border.width = FloatOrInt(1.);
2086 2090
2087- check_ops_with_options(options, &ops);2091+ check_ops_with_options(options, ops);
2088 }2092 }
2089 2093
2090 #[test]2094 #[test]
@@ -2098,7 +2102,7 @@ fn workspace_cleanup_during_switch() {
2098 Op::CloseWindow(1),2102 Op::CloseWindow(1),
2099 ];2103 ];
2100 2104
2101- check_ops(&ops);2105+ check_ops(ops);
2102 }2106 }
2103 2107
2104 #[test]2108 #[test]
@@ -2119,7 +2123,7 @@ fn workspace_transfer_during_switch() {
2119 Op::AddOutput(1),2123 Op::AddOutput(1),
2120 ];2124 ];
2121 2125
2122- check_ops(&ops);2126+ check_ops(ops);
2123 }2127 }
2124 2128
2125 #[test]2129 #[test]
@@ -2135,7 +2139,7 @@ fn workspace_transfer_during_switch_from_last() {
2135 Op::AddOutput(1),2139 Op::AddOutput(1),
2136 ];2140 ];
2137 2141
2138- check_ops(&ops);2142+ check_ops(ops);
2139 }2143 }
2140 2144
2141 #[test]2145 #[test]
@@ -2152,7 +2156,7 @@ fn workspace_transfer_during_switch_gets_cleaned_up() {
2152 Op::AddOutput(1),2156 Op::AddOutput(1),
2153 ];2157 ];
2154 2158
2155- check_ops(&ops);2159+ check_ops(ops);
2156 }2160 }
2157 2161
2158 #[test]2162 #[test]
@@ -2167,7 +2171,7 @@ fn move_workspace_to_output() {
2167 Op::MoveWorkspaceToOutput(2),2171 Op::MoveWorkspaceToOutput(2),
2168 ];2172 ];
2169 2173
2170- let layout = check_ops(&ops);2174+ let layout = check_ops(ops);
2171 2175
2172 let MonitorSet::Normal {2176 let MonitorSet::Normal {
2173 monitors,2177 monitors,
@@ -2203,7 +2207,7 @@ fn open_right_of_on_different_workspace() {
2203 },2207 },
2204 ];2208 ];
2205 2209
2206- let layout = check_ops(&ops);2210+ let layout = check_ops(ops);
2207 2211
2208 let MonitorSet::Normal { monitors, .. } = layout.monitor_set else {2212 let MonitorSet::Normal { monitors, .. } = layout.monitor_set else {
2209 unreachable!()2213 unreachable!()
@@ -2243,7 +2247,7 @@ fn open_right_of_on_different_workspace_ewaf() {
2243 empty_workspace_above_first: true,2247 empty_workspace_above_first: true,
2244 ..Default::default()2248 ..Default::default()
2245 };2249 };
2246- let layout = check_ops_with_options(options, &ops);2250+ let layout = check_ops_with_options(options, ops);
2247 2251
2248 let MonitorSet::Normal { monitors, .. } = layout.monitor_set else {2252 let MonitorSet::Normal { monitors, .. } = layout.monitor_set else {
2249 unreachable!()2253 unreachable!()
@@ -2276,7 +2280,7 @@ fn removing_all_outputs_preserves_empty_named_workspaces() {
2276 Op::RemoveOutput(1),2280 Op::RemoveOutput(1),
2277 ];2281 ];
2278 2282
2279- let layout = check_ops(&ops);2283+ let layout = check_ops(ops);
2280 2284
2281 let MonitorSet::NoOutputs { workspaces } = layout.monitor_set else {2285 let MonitorSet::NoOutputs { workspaces } = layout.monitor_set else {
2282 unreachable!()2286 unreachable!()
@@ -2364,7 +2368,7 @@ fn set_window_height_recomputes_to_auto() {
2364 },2368 },
2365 ];2369 ];
2366 2370
2367- check_ops(&ops);2371+ check_ops(ops);
2368 }2372 }
2369 2373
2370 #[test]2374 #[test]
@@ -2397,7 +2401,7 @@ fn one_window_in_column_becomes_weight_1() {
2397 Op::CloseWindow(1),2401 Op::CloseWindow(1),
2398 ];2402 ];
2399 2403
2400- check_ops(&ops);2404+ check_ops(ops);
2401 }2405 }
2402 2406
2403 #[test]2407 #[test]
@@ -2426,7 +2430,7 @@ fn fixed_height_takes_max_non_auto_into_account() {
2426 gaps: 0.,2430 gaps: 0.,
2427 ..Default::default()2431 ..Default::default()
2428 };2432 };
2429- check_ops_with_options(options, &ops);2433+ check_ops_with_options(options, ops);
2430 }2434 }
2431 2435
2432 #[test]2436 #[test]
@@ -2445,7 +2449,7 @@ fn start_interactive_move_then_remove_window() {
2445 Op::CloseWindow(0),2449 Op::CloseWindow(0),
2446 ];2450 ];
2447 2451
2448- check_ops(&ops);2452+ check_ops(ops);
2449 }2453 }
2450 2454
2451 #[test]2455 #[test]
@@ -2473,7 +2477,7 @@ fn interactive_move_onto_empty_output() {
2473 Op::InteractiveMoveEnd { window: 0 },2477 Op::InteractiveMoveEnd { window: 0 },
2474 ];2478 ];
2475 2479
2476- check_ops(&ops);2480+ check_ops(ops);
2477 }2481 }
2478 2482
2479 #[test]2483 #[test]
@@ -2505,7 +2509,7 @@ fn interactive_move_onto_empty_output_ewaf() {
2505 empty_workspace_above_first: true,2509 empty_workspace_above_first: true,
2506 ..Default::default()2510 ..Default::default()
2507 };2511 };
2508- check_ops_with_options(options, &ops);2512+ check_ops_with_options(options, ops);
2509 }2513 }
2510 2514
2511 #[test]2515 #[test]
@@ -2534,7 +2538,7 @@ fn interactive_move_onto_last_workspace() {
2534 Op::InteractiveMoveEnd { window: 0 },2538 Op::InteractiveMoveEnd { window: 0 },
2535 ];2539 ];
2536 2540
2537- check_ops(&ops);2541+ check_ops(ops);
2538 }2542 }
2539 2543
2540 #[test]2544 #[test]
@@ -2566,7 +2570,7 @@ fn interactive_move_onto_first_empty_workspace() {
2566 empty_workspace_above_first: true,2570 empty_workspace_above_first: true,
2567 ..Default::default()2571 ..Default::default()
2568 };2572 };
2569- check_ops_with_options(options, &ops);2573+ check_ops_with_options(options, ops);
2570 }2574 }
2571 2575
2572 #[test]2576 #[test]
@@ -2584,7 +2588,7 @@ fn output_active_workspace_is_preserved() {
2584 Op::AddOutput(1),2588 Op::AddOutput(1),
2585 ];2589 ];
2586 2590
2587- let layout = check_ops(&ops);2591+ let layout = check_ops(ops);
2588 2592
2589 let MonitorSet::Normal { monitors, .. } = layout.monitor_set else {2593 let MonitorSet::Normal { monitors, .. } = layout.monitor_set else {
2590 unreachable!()2594 unreachable!()
@@ -2609,7 +2613,7 @@ fn output_active_workspace_is_preserved_with_other_outputs() {
2609 Op::AddOutput(1),2613 Op::AddOutput(1),
2610 ];2614 ];
2611 2615
2612- let layout = check_ops(&ops);2616+ let layout = check_ops(ops);
2613 2617
2614 let MonitorSet::Normal { monitors, .. } = layout.monitor_set else {2618 let MonitorSet::Normal { monitors, .. } = layout.monitor_set else {
2615 unreachable!()2619 unreachable!()
@@ -2629,7 +2633,7 @@ fn named_workspace_to_output() {
2629 Op::MoveWorkspaceToOutput(1),2633 Op::MoveWorkspaceToOutput(1),
2630 Op::FocusWorkspaceUp,2634 Op::FocusWorkspaceUp,
2631 ];2635 ];
2632- check_ops(&ops);2636+ check_ops(ops);
2633 }2637 }
2634 2638
2635 #[test]2639 #[test]
@@ -2647,7 +2651,7 @@ fn named_workspace_to_output_ewaf() {
2647 empty_workspace_above_first: true,2651 empty_workspace_above_first: true,
2648 ..Default::default()2652 ..Default::default()
2649 };2653 };
2650- check_ops_with_options(options, &ops);2654+ check_ops_with_options(options, ops);
2651 }2655 }
2652 2656
2653 #[test]2657 #[test]
@@ -2666,7 +2670,7 @@ fn move_window_to_empty_workspace_above_first() {
2666 empty_workspace_above_first: true,2670 empty_workspace_above_first: true,
2667 ..Default::default()2671 ..Default::default()
2668 };2672 };
2669- check_ops_with_options(options, &ops);2673+ check_ops_with_options(options, ops);
2670 }2674 }
2671 2675
2672 #[test]2676 #[test]
@@ -2683,7 +2687,7 @@ fn move_window_to_different_output() {
2683 empty_workspace_above_first: true,2687 empty_workspace_above_first: true,
2684 ..Default::default()2688 ..Default::default()
2685 };2689 };
2686- check_ops_with_options(options, &ops);2690+ check_ops_with_options(options, ops);
2687 }2691 }
2688 2692
2689 #[test]2693 #[test]
@@ -2699,7 +2703,7 @@ fn close_window_empty_ws_above_first() {
2699 empty_workspace_above_first: true,2703 empty_workspace_above_first: true,
2700 ..Default::default()2704 ..Default::default()
2701 };2705 };
2702- check_ops_with_options(options, &ops);2706+ check_ops_with_options(options, ops);
2703 }2707 }
2704 2708
2705 #[test]2709 #[test]
@@ -2716,7 +2720,7 @@ fn add_and_remove_output() {
2716 empty_workspace_above_first: true,2720 empty_workspace_above_first: true,
2717 ..Default::default()2721 ..Default::default()
2718 };2722 };
2719- check_ops_with_options(options, &ops);2723+ check_ops_with_options(options, ops);
2720 }2724 }
2721 2725
2722 #[test]2726 #[test]
@@ -2728,7 +2732,7 @@ fn switch_ewaf_on() {
2728 },2732 },
2729 ];2733 ];
2730 2734
2731- let mut layout = check_ops(&ops);2735+ let mut layout = check_ops(ops);
2732 layout.update_options(Options {2736 layout.update_options(Options {
2733 empty_workspace_above_first: true,2737 empty_workspace_above_first: true,
2734 ..Default::default()2738 ..Default::default()
@@ -2749,7 +2753,7 @@ fn switch_ewaf_off() {
2749 empty_workspace_above_first: true,2753 empty_workspace_above_first: true,
2750 ..Default::default()2754 ..Default::default()
2751 };2755 };
2752- let mut layout = check_ops_with_options(options, &ops);2756+ let mut layout = check_ops_with_options(options, ops);
2753 layout.update_options(Options::default());2757 layout.update_options(Options::default());
2754 layout.verify_invariants();2758 layout.verify_invariants();
2755 }2759 }
@@ -2780,7 +2784,7 @@ fn interactive_move_drop_on_other_output_during_animation() {
2780 Op::RemoveOutput(4),2784 Op::RemoveOutput(4),
2781 Op::InteractiveMoveEnd { window: 3 },2785 Op::InteractiveMoveEnd { window: 3 },
2782 ];2786 ];
2783- check_ops(&ops);2787+ check_ops(ops);
2784 }2788 }
2785 2789
2786 #[test]2790 #[test]
@@ -2813,7 +2817,7 @@ fn add_window_next_to_only_interactively_moved_without_outputs() {
2813 },2817 },
2814 ];2818 ];
2815 2819
2816- check_ops(&ops);2820+ check_ops(ops);
2817 }2821 }
2818 2822
2819 #[test]2823 #[test]
@@ -2842,7 +2846,7 @@ fn interactive_move_toggle_floating_ends_dnd_gesture() {
2842 Op::InteractiveMoveEnd { window: 2 },2846 Op::InteractiveMoveEnd { window: 2 },
2843 ];2847 ];
2844 2848
2845- check_ops(&ops);2849+ check_ops(ops);
2846 }2850 }
2847 2851
2848 #[test]2852 #[test]
@@ -2855,7 +2859,7 @@ fn set_width_fixed_negative() {
2855 Op::ToggleWindowFloating { id: Some(3) },2859 Op::ToggleWindowFloating { id: Some(3) },
2856 Op::SetColumnWidth(SizeChange::SetFixed(-100)),2860 Op::SetColumnWidth(SizeChange::SetFixed(-100)),
2857 ];2861 ];
2858- check_ops(&ops);2862+ check_ops(ops);
2859 }2863 }
2860 2864
2861 #[test]2865 #[test]
@@ -2871,7 +2875,7 @@ fn set_height_fixed_negative() {
2871 change: SizeChange::SetFixed(-100),2875 change: SizeChange::SetFixed(-100),
2872 },2876 },
2873 ];2877 ];
2874- check_ops(&ops);2878+ check_ops(ops);
2875 }2879 }
2876 2880
2877 #[test]2881 #[test]
@@ -2892,7 +2896,7 @@ fn interactive_resize_to_negative() {
2892 dy: -10000.,2896 dy: -10000.,
2893 },2897 },
2894 ];2898 ];
2895- check_ops(&ops);2899+ check_ops(ops);
2896 }2900 }
2897 2901
2898 #[test]2902 #[test]
@@ -2906,7 +2910,7 @@ fn windows_on_other_workspaces_remain_activated() {
2906 Op::Refresh { is_active: true },2910 Op::Refresh { is_active: true },
2907 ];2911 ];
2908 2912
2909- let layout = check_ops(&ops);2913+ let layout = check_ops(ops);
2910 let (_, win) = layout.windows().next().unwrap();2914 let (_, win) = layout.windows().next().unwrap();
2911 assert!(win.0.pending_activated.get());2915 assert!(win.0.pending_activated.get());
2912 }2916 }
@@ -2930,7 +2934,7 @@ fn stacking_add_parent_brings_up_child() {
2930 },2934 },
2931 ];2935 ];
2932 2936
2933- check_ops(&ops);2937+ check_ops(ops);
2934 }2938 }
2935 2939
2936 #[test]2940 #[test]
@@ -2959,7 +2963,7 @@ fn stacking_add_parent_brings_up_descendants() {
2959 },2963 },
2960 ];2964 ];
2961 2965
2962- check_ops(&ops);2966+ check_ops(ops);
2963 }2967 }
2964 2968
2965 #[test]2969 #[test]
@@ -2995,7 +2999,7 @@ fn stacking_activate_brings_up_descendants() {
2995 Op::FocusWindow(0),2999 Op::FocusWindow(0),
2996 ];3000 ];
2997 3001
2998- check_ops(&ops);3002+ check_ops(ops);
2999 }3003 }
3000 3004
3001 #[test]3005 #[test]
@@ -3020,7 +3024,7 @@ fn stacking_set_parent_brings_up_child() {
3020 },3024 },
3021 ];3025 ];
3022 3026
3023- check_ops(&ops);3027+ check_ops(ops);
3024 }3028 }
3025 3029
3026 #[test]3030 #[test]
@@ -3038,7 +3042,7 @@ fn move_window_to_workspace_with_different_active_output() {
3038 },3042 },
3039 ];3043 ];
3040 3044
3041- check_ops(&ops);3045+ check_ops(ops);
3042 }3046 }
3043 3047
3044 #[test]3048 #[test]
@@ -3051,7 +3055,7 @@ fn set_first_workspace_name() {
3051 },3055 },
3052 ];3056 ];
3053 3057
3054- check_ops(&ops);3058+ check_ops(ops);
3055 }3059 }
3056 3060
3057 #[test]3061 #[test]
@@ -3068,7 +3072,7 @@ fn set_first_workspace_name_ewaf() {
3068 empty_workspace_above_first: true,3072 empty_workspace_above_first: true,
3069 ..Default::default()3073 ..Default::default()
3070 };3074 };
3071- check_ops_with_options(options, &ops);3075+ check_ops_with_options(options, ops);
3072 }3076 }
3073 3077
3074 #[test]3078 #[test]
@@ -3085,7 +3089,7 @@ fn set_last_workspace_name() {
3085 },3089 },
3086 ];3090 ];
3087 3091
3088- check_ops(&ops);3092+ check_ops(ops);
3089 }3093 }
3090 3094
3091 #[test]3095 #[test]
@@ -3112,7 +3116,7 @@ fn move_workspace_to_same_monitor_doesnt_reorder() {
3112 },3116 },
3113 ];3117 ];
3114 3118
3115- let layout = check_ops(&ops);3119+ let layout = check_ops(ops);
3116 let counts: Vec<_> = layout3120 let counts: Vec<_> = layout
3117 .workspaces()3121 .workspaces()
3118 .map(|(_, _, ws)| ws.windows().count())3122 .map(|(_, _, ws)| ws.windows().count())
@@ -3140,7 +3144,7 @@ fn removing_window_above_preserves_focused_window() {
3140 Op::CloseWindow(0),3144 Op::CloseWindow(0),
3141 ];3145 ];
3142 3146
3143- let layout = check_ops(&ops);3147+ let layout = check_ops(ops);
3144 let win = layout.focus().unwrap();3148 let win = layout.focus().unwrap();
3145 assert_eq!(win.0.id, 1);3149 assert_eq!(win.0.id, 1);
3146 }3150 }
@@ -3159,7 +3163,7 @@ fn preset_column_width_fixed_correct_with_border() {
3159 preset_column_widths: vec![PresetSize::Fixed(500)],3163 preset_column_widths: vec![PresetSize::Fixed(500)],
3160 ..Default::default()3164 ..Default::default()
3161 };3165 };
3162- let mut layout = check_ops_with_options(options, &ops);3166+ let mut layout = check_ops_with_options(options, ops);
3163 3167
3164 let win = layout.windows().next().unwrap().1;3168 let win = layout.windows().next().unwrap().1;
3165 assert_eq!(win.requested_size().unwrap().w, 500);3169 assert_eq!(win.requested_size().unwrap().w, 500);
@@ -3205,7 +3209,7 @@ fn preset_column_width_reset_after_set_width() {
3205 preset_column_widths: vec![PresetSize::Fixed(500), PresetSize::Fixed(1000)],3209 preset_column_widths: vec![PresetSize::Fixed(500), PresetSize::Fixed(1000)],
3206 ..Default::default()3210 ..Default::default()
3207 };3211 };
3208- let layout = check_ops_with_options(options, &ops);3212+ let layout = check_ops_with_options(options, ops);
3209 let win = layout.windows().next().unwrap().1;3213 let win = layout.windows().next().unwrap().1;
3210 assert_eq!(win.requested_size().unwrap().w, 500);3214 assert_eq!(win.requested_size().unwrap().w, 500);
3211 }3215 }
@@ -3249,7 +3253,7 @@ fn move_column_to_workspace_unfocused_with_multiple_monitors() {
3249 Op::FocusOutput(1),3253 Op::FocusOutput(1),
3250 ];3254 ];
3251 3255
3252- let layout = check_ops(&ops);3256+ let layout = check_ops(ops);
3253 3257
3254 assert_eq!(layout.active_workspace().unwrap().name().unwrap(), "ws102");3258 assert_eq!(layout.active_workspace().unwrap().name().unwrap(), "ws102");
3255 3259
@@ -3287,7 +3291,7 @@ fn move_column_to_workspace_down_focus_false_on_floating_window() {
3287 Op::MoveColumnToWorkspaceDown(false),3291 Op::MoveColumnToWorkspaceDown(false),
3288 ];3292 ];
3289 3293
3290- let layout = check_ops(&ops);3294+ let layout = check_ops(ops);
3291 3295
3292 let MonitorSet::Normal { monitors, .. } = layout.monitor_set else {3296 let MonitorSet::Normal { monitors, .. } = layout.monitor_set else {
3293 unreachable!()3297 unreachable!()
@@ -3310,7 +3314,7 @@ fn move_column_to_workspace_focus_false_on_floating_window() {
3310 Op::MoveColumnToWorkspace(1, false),3314 Op::MoveColumnToWorkspace(1, false),
3311 ];3315 ];
3312 3316
3313- let layout = check_ops(&ops);3317+ let layout = check_ops(ops);
3314 3318
3315 let MonitorSet::Normal { monitors, .. } = layout.monitor_set else {3319 let MonitorSet::Normal { monitors, .. } = layout.monitor_set else {
3316 unreachable!()3320 unreachable!()
@@ -3504,7 +3508,7 @@ proptest! {
3504 post_options in prop::option::of(arbitrary_options()),3508 post_options in prop::option::of(arbitrary_options()),
3505 ) {3509 ) {
3506 // eprintln!("{ops:?}");3510 // eprintln!("{ops:?}");
3507- let mut layout = check_ops_with_options(options, &ops);3511+ let mut layout = check_ops_with_options(options, ops);
3508 3512
3509 if let Some(post_options) = post_options {3513 if let Some(post_options) = post_options {
3510 layout.update_options(post_options);3514 layout.update_options(post_options);
src/layout/tests/animations.rsmodified+27 -27
@@ -62,7 +62,7 @@ fn set_up_two_in_column() -> Layout<TestWindow> {
62 Op::CompleteAnimations,62 Op::CompleteAnimations,
63 ];63 ];
64 64
65- check_ops_with_options(make_options(), &ops)65+ check_ops_with_options(make_options(), ops)
66 }66 }
67 67
68 #[test]68 #[test]
@@ -83,7 +83,7 @@ fn height_resize_animates_next_y() {
83 Op::Communicate(1),83 Op::Communicate(1),
84 Op::Communicate(2),84 Op::Communicate(2),
85 ];85 ];
86- check_ops_on_layout(&mut layout, &ops);86+ check_ops_on_layout(&mut layout, ops);
87 87
88 // No time had passed yet, so we're at the initial state.88 // No time had passed yet, so we're at the initial state.
89 assert_snapshot!(format_tiles(&layout), @r"89 assert_snapshot!(format_tiles(&layout), @r"
@@ -130,7 +130,7 @@ fn clientside_height_change_doesnt_animate() {
130 Op::Communicate(1),130 Op::Communicate(1),
131 Op::Communicate(2),131 Op::Communicate(2),
132 ];132 ];
133- check_ops_on_layout(&mut layout, &ops);133+ check_ops_on_layout(&mut layout, ops);
134 134
135 // No time had passed yet, but we are at the final state right away.135 // No time had passed yet, but we are at the final state right away.
136 assert_snapshot!(format_tiles(&layout), @r"136 assert_snapshot!(format_tiles(&layout), @r"
@@ -166,7 +166,7 @@ fn height_resize_and_back() {
166 // Advance the time halfway.166 // Advance the time halfway.
167 Op::AdvanceAnimations { msec_delta: 500 },167 Op::AdvanceAnimations { msec_delta: 500 },
168 ];168 ];
169- check_ops_on_layout(&mut layout, &ops);169+ check_ops_on_layout(&mut layout, ops);
170 170
171 // Top window is half-resized at 150 px tall, bottom window is at y=150 matching it.171 // Top window is half-resized at 150 px tall, bottom window is at y=150 matching it.
172 assert_snapshot!(format_tiles(&layout), @r"172 assert_snapshot!(format_tiles(&layout), @r"
@@ -189,7 +189,7 @@ fn height_resize_and_back() {
189 Op::Communicate(1),189 Op::Communicate(1),
190 Op::Communicate(2),190 Op::Communicate(2),
191 ];191 ];
192- check_ops_on_layout(&mut layout, &ops);192+ check_ops_on_layout(&mut layout, ops);
193 193
194 // No time had passed yet, and we expect no animation jumps, so this state matches the last.194 // No time had passed yet, and we expect no animation jumps, so this state matches the last.
195 assert_snapshot!(format_tiles(&layout), @r"195 assert_snapshot!(format_tiles(&layout), @r"
@@ -243,7 +243,7 @@ fn height_resize_and_cancel() {
243 // Advance the time slightly.243 // Advance the time slightly.
244 Op::AdvanceAnimations { msec_delta: 50 },244 Op::AdvanceAnimations { msec_delta: 50 },
245 ];245 ];
246- check_ops_on_layout(&mut layout, &ops);246+ check_ops_on_layout(&mut layout, ops);
247 247
248 // Top window is half-resized at 105 px tall, bottom window is at y=105 matching it.248 // Top window is half-resized at 105 px tall, bottom window is at y=105 matching it.
249 assert_snapshot!(format_tiles(&layout), @r"249 assert_snapshot!(format_tiles(&layout), @r"
@@ -267,7 +267,7 @@ fn height_resize_and_cancel() {
267 Op::Communicate(1),267 Op::Communicate(1),
268 Op::Communicate(2),268 Op::Communicate(2),
269 ];269 ];
270- check_ops_on_layout(&mut layout, &ops);270+ check_ops_on_layout(&mut layout, ops);
271 271
272 // Since the resize animation is cancelled, the height goes to the new value immediately. The Y272 // Since the resize animation is cancelled, the height goes to the new value immediately. The Y
273 // position doesn't jump, instead the animation is offset to preserve the current position.273 // position doesn't jump, instead the animation is offset to preserve the current position.
@@ -309,7 +309,7 @@ fn height_resize_and_back_during_another_y_anim() {
309 Op::Communicate(2),309 Op::Communicate(2),
310 Op::CompleteAnimations,310 Op::CompleteAnimations,
311 ];311 ];
312- let mut layout = check_ops_with_options(make_options(), &ops);312+ let mut layout = check_ops_with_options(make_options(), ops);
313 313
314 // The initial state.314 // The initial state.
315 assert_snapshot!(format_tiles(&layout), @r"315 assert_snapshot!(format_tiles(&layout), @r"
@@ -350,7 +350,7 @@ fn height_resize_and_back_during_another_y_anim() {
350 Op::Communicate(1),350 Op::Communicate(1),
351 Op::Communicate(2),351 Op::Communicate(2),
352 ];352 ];
353- check_ops_on_layout(&mut layout, &ops);353+ check_ops_on_layout(&mut layout, ops);
354 354
355 // No time had passed, so no change in state yet.355 // No time had passed, so no change in state yet.
356 assert_snapshot!(format_tiles(&layout), @r"356 assert_snapshot!(format_tiles(&layout), @r"
@@ -383,7 +383,7 @@ fn height_resize_and_back_during_another_y_anim() {
383 Op::Communicate(1),383 Op::Communicate(1),
384 Op::Communicate(2),384 Op::Communicate(2),
385 ];385 ];
386- check_ops_on_layout(&mut layout, &ops);386+ check_ops_on_layout(&mut layout, ops);
387 387
388 // No time had passed, so no change in state yet.388 // No time had passed, so no change in state yet.
389 assert_snapshot!(format_tiles(&layout), @r"389 assert_snapshot!(format_tiles(&layout), @r"
@@ -442,7 +442,7 @@ fn height_resize_and_cancel_during_another_y_anim() {
442 Op::Communicate(2),442 Op::Communicate(2),
443 Op::CompleteAnimations,443 Op::CompleteAnimations,
444 ];444 ];
445- let mut layout = check_ops_with_options(make_options(), &ops);445+ let mut layout = check_ops_with_options(make_options(), ops);
446 446
447 // The initial state.447 // The initial state.
448 assert_snapshot!(format_tiles(&layout), @r"448 assert_snapshot!(format_tiles(&layout), @r"
@@ -485,7 +485,7 @@ fn height_resize_and_cancel_during_another_y_anim() {
485 // Advance the time slightly.485 // Advance the time slightly.
486 Op::AdvanceAnimations { msec_delta: 50 },486 Op::AdvanceAnimations { msec_delta: 50 },
487 ];487 ];
488- check_ops_on_layout(&mut layout, &ops);488+ check_ops_on_layout(&mut layout, ops);
489 489
490 // X changed by 5, but y changed by 8 since the Y movement from the resize compounds with the Y490 // X changed by 5, but y changed by 8 since the Y movement from the resize compounds with the Y
491 // movement from consume-into-column.491 // movement from consume-into-column.
@@ -510,7 +510,7 @@ fn height_resize_and_cancel_during_another_y_anim() {
510 Op::Communicate(1),510 Op::Communicate(1),
511 Op::Communicate(2),511 Op::Communicate(2),
512 ];512 ];
513- check_ops_on_layout(&mut layout, &ops);513+ check_ops_on_layout(&mut layout, ops);
514 514
515 // Since the resize anim was cancelled, second window's Y anim is adjusted to preserve the515 // Since the resize anim was cancelled, second window's Y anim is adjusted to preserve the
516 // current position while targeting the new final position.516 // current position while targeting the new final position.
@@ -577,7 +577,7 @@ fn height_resize_before_another_y_anim_then_back() {
577 // Advance the time a bit.577 // Advance the time a bit.
578 Op::AdvanceAnimations { msec_delta: 200 },578 Op::AdvanceAnimations { msec_delta: 200 },
579 ];579 ];
580- let mut layout = check_ops_with_options(make_options(), &ops);580+ let mut layout = check_ops_with_options(make_options(), ops);
581 581
582 // The resize is in progress.582 // The resize is in progress.
583 assert_snapshot!(format_tiles(&layout), @r"583 assert_snapshot!(format_tiles(&layout), @r"
@@ -620,7 +620,7 @@ fn height_resize_before_another_y_anim_then_back() {
620 Op::Communicate(1),620 Op::Communicate(1),
621 Op::Communicate(2),621 Op::Communicate(2),
622 ];622 ];
623- check_ops_on_layout(&mut layout, &ops);623+ check_ops_on_layout(&mut layout, ops);
624 624
625 // No time had passed, so no change in state yet.625 // No time had passed, so no change in state yet.
626 assert_snapshot!(format_tiles(&layout), @r"626 assert_snapshot!(format_tiles(&layout), @r"
@@ -692,7 +692,7 @@ fn height_resize_before_another_y_anim_then_cancel() {
692 // Advance the time a bit.692 // Advance the time a bit.
693 Op::AdvanceAnimations { msec_delta: 20 },693 Op::AdvanceAnimations { msec_delta: 20 },
694 ];694 ];
695- let mut layout = check_ops_with_options(make_options(), &ops);695+ let mut layout = check_ops_with_options(make_options(), ops);
696 696
697 // The resize is in progress.697 // The resize is in progress.
698 assert_snapshot!(format_tiles(&layout), @r"698 assert_snapshot!(format_tiles(&layout), @r"
@@ -734,7 +734,7 @@ fn height_resize_before_another_y_anim_then_cancel() {
734 Op::Communicate(1),734 Op::Communicate(1),
735 Op::Communicate(2),735 Op::Communicate(2),
736 ];736 ];
737- check_ops_on_layout(&mut layout, &ops);737+ check_ops_on_layout(&mut layout, ops);
738 738
739 // The second window's trajectory readjusts to the new final position at 100 px, without jumps.739 // The second window's trajectory readjusts to the new final position at 100 px, without jumps.
740 assert_snapshot!(format_tiles(&layout), @r"740 assert_snapshot!(format_tiles(&layout), @r"
@@ -781,7 +781,7 @@ fn clientside_height_change_during_another_y_anim() {
781 // Advance the time a bit.781 // Advance the time a bit.
782 Op::AdvanceAnimations { msec_delta: 200 },782 Op::AdvanceAnimations { msec_delta: 200 },
783 ];783 ];
784- let mut layout = check_ops_with_options(make_options(), &ops);784+ let mut layout = check_ops_with_options(make_options(), ops);
785 785
786 // Second window on its way to the bottom.786 // Second window on its way to the bottom.
787 assert_snapshot!(format_tiles(&layout), @r"787 assert_snapshot!(format_tiles(&layout), @r"
@@ -798,7 +798,7 @@ fn clientside_height_change_during_another_y_anim() {
798 Op::Communicate(1),798 Op::Communicate(1),
799 Op::Communicate(2),799 Op::Communicate(2),
800 ];800 ];
801- check_ops_on_layout(&mut layout, &ops);801+ check_ops_on_layout(&mut layout, ops);
802 802
803 // The second window's trajectory readjusts to the new final position at 200 px, without jumps.803 // The second window's trajectory readjusts to the new final position at 200 px, without jumps.
804 assert_snapshot!(format_tiles(&layout), @r"804 assert_snapshot!(format_tiles(&layout), @r"
@@ -857,7 +857,7 @@ fn height_resize_cancel_with_stationary_second_window() {
857 let mut options = make_options();857 let mut options = make_options();
858 // Window movement will happen instantly.858 // Window movement will happen instantly.
859 options.animations.window_movement.0.off = true;859 options.animations.window_movement.0.off = true;
860- let mut layout = check_ops_with_options(options, &ops);860+ let mut layout = check_ops_with_options(options, ops);
861 861
862 // The resize is in progress.862 // The resize is in progress.
863 assert_snapshot!(format_tiles(&layout), @r"863 assert_snapshot!(format_tiles(&layout), @r"
@@ -901,7 +901,7 @@ fn height_resize_cancel_with_stationary_second_window() {
901 Op::Communicate(1),901 Op::Communicate(1),
902 Op::Communicate(2),902 Op::Communicate(2),
903 ];903 ];
904- check_ops_on_layout(&mut layout, &ops);904+ check_ops_on_layout(&mut layout, ops);
905 905
906 // This causes the second window to jump down, which is correct because it hadn't been in an906 // This causes the second window to jump down, which is correct because it hadn't been in an
907 // animation, and as far as it's concerned, this is the same case as a window just deciding to907 // animation, and as far as it's concerned, this is the same case as a window just deciding to
@@ -937,7 +937,7 @@ fn width_resize_and_cancel() {
937 Op::Communicate(2),937 Op::Communicate(2),
938 Op::CompleteAnimations,938 Op::CompleteAnimations,
939 ];939 ];
940- let mut layout = check_ops_with_options(make_options(), &ops);940+ let mut layout = check_ops_with_options(make_options(), ops);
941 941
942 // The initial state.942 // The initial state.
943 assert_snapshot!(format_tiles(&layout), @r"943 assert_snapshot!(format_tiles(&layout), @r"
@@ -962,7 +962,7 @@ fn width_resize_and_cancel() {
962 // Advance the time slightly.962 // Advance the time slightly.
963 Op::AdvanceAnimations { msec_delta: 50 },963 Op::AdvanceAnimations { msec_delta: 50 },
964 ];964 ];
965- check_ops_on_layout(&mut layout, &ops);965+ check_ops_on_layout(&mut layout, ops);
966 966
967 // Left window is half-resized at 105 px wide, right window is at x=105 matching it.967 // Left window is half-resized at 105 px wide, right window is at x=105 matching it.
968 assert_snapshot!(format_tiles(&layout), @r"968 assert_snapshot!(format_tiles(&layout), @r"
@@ -986,7 +986,7 @@ fn width_resize_and_cancel() {
986 Op::Communicate(1),986 Op::Communicate(1),
987 Op::Communicate(2),987 Op::Communicate(2),
988 ];988 ];
989- check_ops_on_layout(&mut layout, &ops);989+ check_ops_on_layout(&mut layout, ops);
990 990
991 // Since the resize animation is cancelled, the width goes to the new value immediately. The X991 // Since the resize animation is cancelled, the width goes to the new value immediately. The X
992 // position doesn't jump, instead the animation is restarted to preserve the current position.992 // position doesn't jump, instead the animation is restarted to preserve the current position.
@@ -1027,7 +1027,7 @@ fn width_resize_and_cancel_of_column_to_the_left() {
1027 Op::Communicate(2),1027 Op::Communicate(2),
1028 Op::CompleteAnimations,1028 Op::CompleteAnimations,
1029 ];1029 ];
1030- let mut layout = check_ops_with_options(make_options(), &ops);1030+ let mut layout = check_ops_with_options(make_options(), ops);
1031 1031
1032 // The initial state.1032 // The initial state.
1033 assert_snapshot!(format_tiles(&layout), @r"1033 assert_snapshot!(format_tiles(&layout), @r"
@@ -1052,7 +1052,7 @@ fn width_resize_and_cancel_of_column_to_the_left() {
1052 // Advance the time slightly.1052 // Advance the time slightly.
1053 Op::AdvanceAnimations { msec_delta: 50 },1053 Op::AdvanceAnimations { msec_delta: 50 },
1054 ];1054 ];
1055- check_ops_on_layout(&mut layout, &ops);1055+ check_ops_on_layout(&mut layout, ops);
1056 1056
1057 // Left window is half-resized at 105 px wide, it's at x=-5 matching the right edge position.1057 // Left window is half-resized at 105 px wide, it's at x=-5 matching the right edge position.
1058 assert_snapshot!(format_tiles(&layout), @r"1058 assert_snapshot!(format_tiles(&layout), @r"
@@ -1076,7 +1076,7 @@ fn width_resize_and_cancel_of_column_to_the_left() {
1076 Op::Communicate(1),1076 Op::Communicate(1),
1077 Op::Communicate(2),1077 Op::Communicate(2),
1078 ];1078 ];
1079- check_ops_on_layout(&mut layout, &ops);1079+ check_ops_on_layout(&mut layout, ops);
1080 1080
1081 // Since the resize animation is cancelled, the width goes to the new value immediately. The X1081 // Since the resize animation is cancelled, the width goes to the new value immediately. The X
1082 // position doesn't jump, instead the animation is restarted to preserve the current position.1082 // position doesn't jump, instead the animation is restarted to preserve the current position.
src/layout/tests/fullscreen.rsmodified+34 -34
@@ -12,7 +12,7 @@ fn fullscreen() {
12 Op::FullscreenWindow(1),12 Op::FullscreenWindow(1),
13 ];13 ];
14 14
15- check_ops(&ops);15+ check_ops(ops);
16 }16 }
17 17
18 #[test]18 #[test]
@@ -32,7 +32,7 @@ fn unfullscreen_window_in_column() {
32 },32 },
33 ];33 ];
34 34
35- check_ops(&ops);35+ check_ops(ops);
36 }36 }
37 37
38 #[test]38 #[test]
@@ -49,7 +49,7 @@ fn unfullscreen_view_offset_not_reset_on_removal() {
49 Op::ConsumeOrExpelWindowRight { id: None },49 Op::ConsumeOrExpelWindowRight { id: None },
50 ];50 ];
51 51
52- check_ops(&ops);52+ check_ops(ops);
53 }53 }
54 54
55 #[test]55 #[test]
@@ -66,7 +66,7 @@ fn unfullscreen_view_offset_not_reset_on_consume() {
66 Op::ConsumeWindowIntoColumn,66 Op::ConsumeWindowIntoColumn,
67 ];67 ];
68 68
69- check_ops(&ops);69+ check_ops(ops);
70 }70 }
71 71
72 #[test]72 #[test]
@@ -80,7 +80,7 @@ fn unfullscreen_view_offset_not_reset_on_quick_double_toggle() {
80 Op::FullscreenWindow(0),80 Op::FullscreenWindow(0),
81 ];81 ];
82 82
83- check_ops(&ops);83+ check_ops(ops);
84 }84 }
85 85
86 #[test]86 #[test]
@@ -97,7 +97,7 @@ fn unfullscreen_view_offset_set_on_fullscreening_inactive_tile_in_column() {
97 Op::FullscreenWindow(0),97 Op::FullscreenWindow(0),
98 ];98 ];
99 99
100- check_ops(&ops);100+ check_ops(ops);
101 }101 }
102 102
103 #[test]103 #[test]
@@ -121,7 +121,7 @@ fn unfullscreen_view_offset_not_reset_on_gesture() {
121 },121 },
122 ];122 ];
123 123
124- check_ops(&ops);124+ check_ops(ops);
125 }125 }
126 126
127 #[test]127 #[test]
@@ -154,7 +154,7 @@ fn one_window_in_column_becomes_weight_1_after_fullscreen() {
154 Op::FullscreenWindow(1),154 Op::FullscreenWindow(1),
155 ];155 ];
156 156
157- check_ops(&ops);157+ check_ops(ops);
158 }158 }
159 159
160 #[test]160 #[test]
@@ -173,7 +173,7 @@ fn disable_tabbed_mode_in_fullscreen() {
173 Op::ToggleColumnTabbedDisplay,173 Op::ToggleColumnTabbedDisplay,
174 ];174 ];
175 175
176- check_ops(&ops);176+ check_ops(ops);
177 }177 }
178 178
179 #[test]179 #[test]
@@ -195,7 +195,7 @@ fn unfullscreen_with_large_border() {
195 },195 },
196 ..Default::default()196 ..Default::default()
197 };197 };
198- check_ops_with_options(options, &ops);198+ check_ops_with_options(options, ops);
199 }199 }
200 200
201 #[test]201 #[test]
@@ -210,7 +210,7 @@ fn fullscreen_to_windowed_fullscreen() {
210 Op::ToggleWindowedFullscreen(0),210 Op::ToggleWindowedFullscreen(0),
211 ];211 ];
212 212
213- check_ops(&ops);213+ check_ops(ops);
214 }214 }
215 215
216 #[test]216 #[test]
@@ -226,7 +226,7 @@ fn windowed_fullscreen_to_fullscreen() {
226 Op::FullscreenWindow(0), // Switch is_fullscreen() back to true.226 Op::FullscreenWindow(0), // Switch is_fullscreen() back to true.
227 ];227 ];
228 228
229- check_ops(&ops);229+ check_ops(ops);
230 }230 }
231 231
232 #[test]232 #[test]
@@ -247,7 +247,7 @@ fn move_pending_unfullscreen_window_out_of_active_column() {
247 Op::MoveWindowToWorkspaceDown(true),247 Op::MoveWindowToWorkspaceDown(true),
248 ];248 ];
249 249
250- check_ops(&ops);250+ check_ops(ops);
251 }251 }
252 252
253 #[test]253 #[test]
@@ -272,7 +272,7 @@ fn move_unfocused_pending_unfullscreen_window_out_of_active_column() {
272 },272 },
273 ];273 ];
274 274
275- check_ops(&ops);275+ check_ops(ops);
276 }276 }
277 277
278 #[test]278 #[test]
@@ -294,7 +294,7 @@ fn interactive_resize_on_pending_unfullscreen_column() {
294 Op::Communicate(2),294 Op::Communicate(2),
295 ];295 ];
296 296
297- check_ops(&ops);297+ check_ops(ops);
298 }298 }
299 299
300 #[test]300 #[test]
@@ -332,7 +332,7 @@ fn interactive_move_unfullscreen_to_floating_stops_dnd_scroll() {
332 Op::InteractiveMoveEnd { window: 4 },332 Op::InteractiveMoveEnd { window: 4 },
333 ];333 ];
334 334
335- check_ops(&ops);335+ check_ops(ops);
336 }336 }
337 337
338 #[test]338 #[test]
@@ -353,7 +353,7 @@ fn unfullscreen_view_offset_not_reset_during_dnd_gesture() {
353 Op::Communicate(3),353 Op::Communicate(3),
354 ];354 ];
355 355
356- check_ops(&ops);356+ check_ops(ops);
357 }357 }
358 358
359 #[test]359 #[test]
@@ -374,7 +374,7 @@ fn unfullscreen_view_offset_not_reset_during_gesture() {
374 Op::Communicate(3),374 Op::Communicate(3),
375 ];375 ];
376 376
377- check_ops(&ops);377+ check_ops(ops);
378 }378 }
379 379
380 #[test]380 #[test]
@@ -395,7 +395,7 @@ fn unfullscreen_view_offset_not_reset_during_ongoing_gesture() {
395 Op::Communicate(3),395 Op::Communicate(3),
396 ];396 ];
397 397
398- check_ops(&ops);398+ check_ops(ops);
399 }399 }
400 400
401 #[test]401 #[test]
@@ -410,7 +410,7 @@ fn unfullscreen_preserves_view_pos() {
410 },410 },
411 ];411 ];
412 412
413- let mut layout = check_ops(&ops);413+ let mut layout = check_ops(ops);
414 414
415 // View pos is looking at the first window.415 // View pos is looking at the first window.
416 assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"-16");416 assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"-16");
@@ -420,7 +420,7 @@ fn unfullscreen_preserves_view_pos() {
420 Op::Communicate(2),420 Op::Communicate(2),
421 Op::CompleteAnimations,421 Op::CompleteAnimations,
422 ];422 ];
423- check_ops_on_layout(&mut layout, &ops);423+ check_ops_on_layout(&mut layout, ops);
424 424
425 // View pos = width of first window + gap.425 // View pos = width of first window + gap.
426 assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"116");426 assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"116");
@@ -430,7 +430,7 @@ fn unfullscreen_preserves_view_pos() {
430 Op::Communicate(2),430 Op::Communicate(2),
431 Op::CompleteAnimations,431 Op::CompleteAnimations,
432 ];432 ];
433- check_ops_on_layout(&mut layout, &ops);433+ check_ops_on_layout(&mut layout, ops);
434 434
435 // View pos is back to showing the first window.435 // View pos is back to showing the first window.
436 assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"-16");436 assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"-16");
@@ -456,7 +456,7 @@ fn unfullscreen_of_tabbed_preserves_view_pos() {
456 Op::FocusColumnRight,456 Op::FocusColumnRight,
457 ];457 ];
458 458
459- let mut layout = check_ops(&ops);459+ let mut layout = check_ops(ops);
460 460
461 // View pos is looking at the first window.461 // View pos is looking at the first window.
462 assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"-16");462 assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"-16");
@@ -467,7 +467,7 @@ fn unfullscreen_of_tabbed_preserves_view_pos() {
467 Op::Communicate(3),467 Op::Communicate(3),
468 Op::CompleteAnimations,468 Op::CompleteAnimations,
469 ];469 ];
470- check_ops_on_layout(&mut layout, &ops);470+ check_ops_on_layout(&mut layout, ops);
471 471
472 // View pos = width of first window + gap.472 // View pos = width of first window + gap.
473 assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"116");473 assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"116");
@@ -477,13 +477,13 @@ fn unfullscreen_of_tabbed_preserves_view_pos() {
477 Op::Communicate(3),477 Op::Communicate(3),
478 Op::CompleteAnimations,478 Op::CompleteAnimations,
479 ];479 ];
480- check_ops_on_layout(&mut layout, &ops);480+ check_ops_on_layout(&mut layout, ops);
481 481
482 // View pos is still on the second column because the second tile hasn't unfullscreened yet.482 // View pos is still on the second column because the second tile hasn't unfullscreened yet.
483 assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"116");483 assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"116");
484 484
485 let ops = [Op::Communicate(2), Op::CompleteAnimations];485 let ops = [Op::Communicate(2), Op::CompleteAnimations];
486- check_ops_on_layout(&mut layout, &ops);486+ check_ops_on_layout(&mut layout, ops);
487 487
488 // View pos is back to showing the first window.488 // View pos is back to showing the first window.
489 assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"-16");489 assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"-16");
@@ -509,7 +509,7 @@ fn unfullscreen_of_tabbed_via_change_to_normal_preserves_view_pos() {
509 Op::FocusColumnRight,509 Op::FocusColumnRight,
510 ];510 ];
511 511
512- let mut layout = check_ops(&ops);512+ let mut layout = check_ops(ops);
513 513
514 // View pos is looking at the first window.514 // View pos is looking at the first window.
515 assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"-16");515 assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"-16");
@@ -520,7 +520,7 @@ fn unfullscreen_of_tabbed_via_change_to_normal_preserves_view_pos() {
520 Op::Communicate(3),520 Op::Communicate(3),
521 Op::CompleteAnimations,521 Op::CompleteAnimations,
522 ];522 ];
523- check_ops_on_layout(&mut layout, &ops);523+ check_ops_on_layout(&mut layout, ops);
524 524
525 // View pos = width of first window + gap.525 // View pos = width of first window + gap.
526 assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"116");526 assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"116");
@@ -530,13 +530,13 @@ fn unfullscreen_of_tabbed_via_change_to_normal_preserves_view_pos() {
530 Op::Communicate(3),530 Op::Communicate(3),
531 Op::CompleteAnimations,531 Op::CompleteAnimations,
532 ];532 ];
533- check_ops_on_layout(&mut layout, &ops);533+ check_ops_on_layout(&mut layout, ops);
534 534
535 // View pos is still on the second column because the second tile hasn't unfullscreened yet.535 // View pos is still on the second column because the second tile hasn't unfullscreened yet.
536 assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"116");536 assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"116");
537 537
538 let ops = [Op::Communicate(2), Op::CompleteAnimations];538 let ops = [Op::Communicate(2), Op::CompleteAnimations];
539- check_ops_on_layout(&mut layout, &ops);539+ check_ops_on_layout(&mut layout, ops);
540 540
541 // View pos is back to showing the first window.541 // View pos is back to showing the first window.
542 assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"-16");542 assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"-16");
@@ -557,7 +557,7 @@ fn removing_only_fullscreen_tile_updates_view_offset() {
557 Op::CompleteAnimations,557 Op::CompleteAnimations,
558 ];558 ];
559 559
560- let mut layout = check_ops(&ops);560+ let mut layout = check_ops(ops);
561 561
562 // View pos with gap.562 // View pos with gap.
563 assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"-16");563 assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"-16");
@@ -568,7 +568,7 @@ fn removing_only_fullscreen_tile_updates_view_offset() {
568 Op::Communicate(2),568 Op::Communicate(2),
569 Op::CompleteAnimations,569 Op::CompleteAnimations,
570 ];570 ];
571- check_ops_on_layout(&mut layout, &ops);571+ check_ops_on_layout(&mut layout, ops);
572 572
573 // View pos without gap because we went fullscreen.573 // View pos without gap because we went fullscreen.
574 assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"0");574 assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"0");
@@ -579,7 +579,7 @@ fn removing_only_fullscreen_tile_updates_view_offset() {
579 Op::Communicate(2),579 Op::Communicate(2),
580 Op::CompleteAnimations,580 Op::CompleteAnimations,
581 ];581 ];
582- check_ops_on_layout(&mut layout, &ops);582+ check_ops_on_layout(&mut layout, ops);
583 583
584 // View pos without gap because other tile is still fullscreen.584 // View pos without gap because other tile is still fullscreen.
585 assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"0");585 assert_snapshot!(layout.active_workspace().unwrap().scrolling().view_pos(), @"0");
@@ -589,7 +589,7 @@ fn removing_only_fullscreen_tile_updates_view_offset() {
589 Op::ConsumeOrExpelWindowRight { id: Some(1) },589 Op::ConsumeOrExpelWindowRight { id: Some(1) },
590 Op::CompleteAnimations,590 Op::CompleteAnimations,
591 ];591 ];
592- check_ops_on_layout(&mut layout, &ops);592+ check_ops_on_layout(&mut layout, ops);
593 593
594 // View pos should include gap now that the column is no longer fullscreen.594 // View pos should include gap now that the column is no longer fullscreen.
595 // FIXME: currently, removing a tile doesn't cause the view offset to update.595 // FIXME: currently, removing a tile doesn't cause the view offset to update.