tests: introduce is_num_children test

This makes it clearer what the tests are actually doing and kills quite
a bit of useless repetitions
This commit is contained in:
Michael Stapelberg
2012-09-04 22:24:13 +02:00
parent 65e5bcfdf4
commit 232d6ccce9
11 changed files with 123 additions and 90 deletions

View File

@ -100,14 +100,12 @@ is($nodes->[1]->{id}, $second, 'second container on bottom');
# move it outside again
cmd 'move left';
$content = get_ws_content($tmp);
is(@{$content}, 3, 'three nodes on this workspace');
is_num_children($tmp, 3, 'three containers after moving left');
# due to automatic flattening/cleanup, the remaining split container
# will be replaced by the con itself, so we will still have 3 nodes
cmd 'move right';
$content = get_ws_content($tmp);
is(@{$content}, 2, 'two nodes on this workspace');
is_num_children($tmp, 2, 'two containers after moving right (flattening)');
######################################################################
# 4) We create two v-split containers on the workspace, then we move
@ -128,8 +126,7 @@ cmd "move right";
cmd 'focus left';
cmd "move right";
$content = get_ws_content($otmp);
is(@{$content}, 1, 'only one nodes on this workspace');
is_num_children($otmp, 1, 'only one node on this workspace');
######################################################################
# 5) test moving floating containers.