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

@ -22,15 +22,13 @@ sync_with_i3;
sub verify_scratchpad_doesnt_move {
my ($ws) = @_;
is(scalar @{get_ws($ws)->{nodes}}, 0, 'no nodes on this ws');
is_num_children($ws, 0, 'no nodes on this ws');
my $window = open_window;
is(scalar @{get_ws($ws)->{nodes}}, 1, 'one nodes on this ws');
is_num_children($ws, 1, 'one node on this ws');
cmd 'move scratchpad';
is(scalar @{get_ws($ws)->{nodes}}, 0, 'no nodes on this ws');
is_num_children($ws, 0, 'no nodes on this ws');
my $last_x = -1;
for (1 .. 20) {