From fbebd3479b615abe8924ceb158df43b708d682bd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ingo=20B=C3=BCrk?= Date: Wed, 15 Apr 2015 20:38:33 +0200 Subject: [PATCH] Added testcase for moving a window to a workspace holding the mark --- testcases/t/243-move-to-mark.t | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/testcases/t/243-move-to-mark.t b/testcases/t/243-move-to-mark.t index 86d71864..a9250770 100644 --- a/testcases/t/243-move-to-mark.t +++ b/testcases/t/243-move-to-mark.t @@ -114,8 +114,8 @@ $S = open_window; # open tabbed container ['A' 'M' 'B'] $target_ws = fresh_workspace; -cmd 'layout tabbed'; $A = open_window; +cmd 'layout tabbed'; $M = open_window; cmd 'mark target'; $B = open_window; @@ -143,8 +143,8 @@ $source_ws = fresh_workspace; $S = open_window; $target_ws = fresh_workspace; -cmd 'layout tabbed'; $A = open_window; +cmd 'layout tabbed'; cmd 'focus parent'; cmd 'mark target'; cmd 'focus child'; @@ -175,8 +175,8 @@ $S = open_window; # open tabbed container ['A'['B' 'M']] $target_ws = fresh_workspace; -cmd 'layout tabbed'; $A = open_window; +cmd 'layout tabbed'; $B = open_window; cmd 'split h'; $M = open_window; @@ -205,8 +205,8 @@ is($nodes->[2]->{window}, $S->{id}, 'S is the third tab'); $source_ws = fresh_workspace; $S = open_window; $target_ws = fresh_workspace; -cmd 'layout tabbed'; $A = open_window; +cmd 'layout tabbed'; $B = open_window; cmd 'focus parent'; cmd 'mark target'; @@ -225,6 +225,31 @@ is($nodes->[0]->{window}, $A->{id}, 'A is the first tab'); is($nodes->[1]->{window}, $B->{id}, 'B is the second tab'); is($nodes->[2]->{window}, $S->{id}, 'S is the third tab'); +############################################################################### +# Given 'S', 'A', 'F' and 'M', where 'M' is a workspace containing a tabbed +# container, when 'S' is moved to 'M', then 'S' does not end up as a tab, but +# rather as a new window next to the tabbed container. +############################################################################### + +$source_ws = fresh_workspace; +$S = open_window; +$target_ws = fresh_workspace; +$A = open_window; +cmd 'layout tabbed'; +$F = open_window; +$M = $target_ws; +cmd 'focus parent'; +cmd 'focus parent'; +cmd 'mark target'; +cmd 'focus ' . $source_ws; + +cmd '[id="' . $S->{id} . '"] move container to mark target'; +sync_with_i3; + +($nodes, $focus) = get_ws_content($target_ws); +is(@{$nodes}, 2, 'there is a tabbed container and a window'); +is($nodes->[1]->{window}, $S->{id}, 'S is the second window'); + ############################################################################### # Given 'S', 'F' and 'M' where 'F' and 'M' are containers inside the same # tabbed container and where 'F' has the focus within that container, when -- 2.39.5