2011-01-27 11:23:29 -05:00
|
|
|
#!perl
|
|
|
|
# vim:ts=4:sw=4:expandtab
|
|
|
|
#
|
2012-09-10 08:09:01 -04:00
|
|
|
# Please read the following documents before working on tests:
|
|
|
|
# • http://build.i3wm.org/docs/testsuite.html
|
|
|
|
# (or docs/testsuite)
|
|
|
|
#
|
|
|
|
# • http://build.i3wm.org/docs/lib-i3test.html
|
|
|
|
# (alternatively: perldoc ./testcases/lib/i3test.pm)
|
|
|
|
#
|
|
|
|
# • http://build.i3wm.org/docs/ipc.html
|
|
|
|
# (or docs/ipc)
|
|
|
|
#
|
|
|
|
# • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
|
|
|
|
# (unless you are already familiar with Perl)
|
|
|
|
#
|
2011-03-09 14:25:17 -05:00
|
|
|
use i3test;
|
2011-01-27 11:23:29 -05:00
|
|
|
|
2011-03-09 14:25:17 -05:00
|
|
|
my $tmp = fresh_workspace;
|
2011-01-27 11:23:29 -05:00
|
|
|
|
2011-11-21 18:47:32 -05:00
|
|
|
my $left = open_window;
|
|
|
|
my $mid = open_window;
|
2011-01-27 11:23:29 -05:00
|
|
|
|
|
|
|
cmd 'split v';
|
2011-11-21 18:47:32 -05:00
|
|
|
my $bottom = open_window;
|
2011-01-27 11:23:29 -05:00
|
|
|
|
|
|
|
my ($nodes, $focus) = get_ws_content($tmp);
|
|
|
|
|
|
|
|
#############################################################################
|
|
|
|
# 1: open a floating window, get it mapped
|
|
|
|
#############################################################################
|
|
|
|
|
|
|
|
# Create a floating window
|
2011-11-21 19:00:54 -05:00
|
|
|
my $window = open_floating_window;
|
2011-01-27 11:23:29 -05:00
|
|
|
ok($window->mapped, 'Window is mapped');
|
|
|
|
|
|
|
|
($nodes, $focus) = get_ws_content($tmp);
|
|
|
|
is(@{$nodes->[1]->{nodes}}, 2, 'two windows in split con');
|
|
|
|
|
|
|
|
#############################################################################
|
|
|
|
# 2: make it tiling, see where it ends up
|
|
|
|
#############################################################################
|
|
|
|
|
2011-06-09 20:06:47 -04:00
|
|
|
cmd 'floating toggle';
|
2011-01-27 11:23:29 -05:00
|
|
|
|
2011-11-21 15:04:00 -05:00
|
|
|
($nodes, $focus) = get_ws_content($tmp);
|
2011-01-27 11:23:29 -05:00
|
|
|
|
2011-06-09 20:06:47 -04:00
|
|
|
is(@{$nodes->[1]->{nodes}}, 3, 'three windows in split con after floating toggle');
|
2011-03-09 14:25:17 -05:00
|
|
|
|
|
|
|
done_testing;
|