]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/122-split.t
added "toggle" option to "split" command
[i3/i3] / testcases / t / 122-split.t
index e9d069385c3895ad2bb9a337c6c642209c32a042..6fd9b0e747313da53d43707c7601960f5c7d2e81 100644 (file)
@@ -178,4 +178,34 @@ is(@{$content}, 2, 'two containers on workspace');
 is(@{$fst->{nodes}}, 2, 'first child has two children');
 is(@{$snd->{nodes}}, 0, 'second child has no children');
 
+######################################################################
+# Test split toggle
+######################################################################
+
+$tmp = fresh_workspace;
+cmd 'split h';
+cmd 'split toggle';
+$ws = get_ws($tmp);
+is($ws->{layout}, 'splitv', 'toggled workspace split');
+
+$tmp = fresh_workspace;
+cmd 'split h';
+cmd 'split toggle';
+cmd 'split toggle';
+$ws = get_ws($tmp);
+is($ws->{layout}, 'splith', 'toggled workspace back and forth');
+
+cmd 'open';
+cmd 'open';
+cmd 'split toggle';
+
+$content = get_ws_content($tmp);
+my $second = $content->[1];
+is($second->{layout}, 'splitv', 'toggled container orientation to vertical');
+
+cmd 'split toggle';
+$content = get_ws_content($tmp);
+$second = $content->[1];
+is($second->{layout}, 'splith', 'toggled container orientation back to horizontal');
+
 done_testing;