added "toggle" option to "split" command

as requested in #1814
This commit is contained in:
Johannes Lange
2016-01-04 17:31:47 +01:00
parent a9f31b9dc9
commit 8bfd06c3dd
5 changed files with 62 additions and 13 deletions

View 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;