From a34a0048a1a9c009e23162f3039254768fc2fa8e Mon Sep 17 00:00:00 2001 From: hwangcc23 Date: Sun, 6 Aug 2017 23:08:05 +0800 Subject: [PATCH] Add regression tests for #2846 1). Add one regression test in 167-workspace_layout.t: - Get a fresh workspace - Set the layout to something - Create windows - Try to switch to another layout - Check if successful - Repeat for all 12 possible transitions 2). Add another regression test in 167-workspace_layout.t: - Check that the command 'layout toggle split' works regardless of what layout we're using --- testcases/t/167-workspace_layout.t | 67 ++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/testcases/t/167-workspace_layout.t b/testcases/t/167-workspace_layout.t index d983eb85..597d545e 100644 --- a/testcases/t/167-workspace_layout.t +++ b/testcases/t/167-workspace_layout.t @@ -375,7 +375,74 @@ ok(@content == 2, 'two containers opened'); isnt($content[0]->{layout}, 'tabbed', 'layout not tabbed'); isnt($content[1]->{layout}, 'tabbed', 'layout not tabbed'); +exit_gracefully($pid); + +##################################################################### +# 16: Check that the command 'layout toggle split' works regardless +# of what layout we're using. +##################################################################### + +$config = <{layout}, 'splitv', 'layout toggles to splitv'); + } else { + is($content[0]->{layout}, 'splith', 'layout toggles to splith'); + } + + cmd '[id="' . $first->id . '"] kill'; + cmd '[id="' . $second->id . '"] kill'; + sync_with_i3; +} exit_gracefully($pid); +##################################################################### +# 17: Check about setting a new layout. +##################################################################### + +$config = <{layout}, $second_layout, 'layout changes to ' . $second_layout); + + cmd '[id="' . $first->id . '"] kill'; + cmd '[id="' . $second->id . '"] kill'; + sync_with_i3; + } +} + done_testing; -- 2.39.5