-cmd 'resize set 100 px 250 px';
-
-@content = @{get_ws($tmp)->{floating_nodes}};
-cmp_ok($content[0]->{rect}->{x}, '==', $oldrect->{x}, 'x untouched');
-cmp_ok($content[0]->{rect}->{y}, '==', $oldrect->{y}, 'y untouched');
-cmp_ok($content[0]->{rect}->{width}, '!=', $oldrect->{width}, 'width changed');
-cmp_ok($content[0]->{rect}->{height}, '!=', $oldrect->{width}, 'height changed');
-cmp_ok($content[0]->{rect}->{width}, '==', 100, 'width changed to 100 px');
-cmp_ok($content[0]->{rect}->{height}, '==', 250, 'height changed to 250 px');
+sub do_test {
+ my ($width, $height) = @_;
+
+ cmp_ok($content[0]->{rect}->{x}, '==', $oldrect->{x}, 'x unchanged');
+ cmp_ok($content[0]->{rect}->{y}, '==', $oldrect->{y}, 'y unchanged');
+
+ @content = @{get_ws($tmp)->{floating_nodes}};
+ if ($width) {
+ cmp_ok($content[0]->{rect}->{width}, '==', $width, "width changed to $width px");
+ } else {
+ cmp_ok($content[0]->{rect}->{width}, '==', $oldrect->{width}, 'width unchanged');
+ }
+ if ($height) {
+ cmp_ok($content[0]->{rect}->{height}, '==', $height, "height changed to $height px");
+ } else {
+ cmp_ok($content[0]->{rect}->{height}, '==', $oldrect->{height}, 'height unchanged');
+ }
+ $oldrect = $content[0]->{rect};
+}