From: Michael Stapelberg Date: Sat, 24 Sep 2011 14:44:42 +0000 (+0100) Subject: tests: lib/i3test: Use //= instead of unless exists $args{key} (Thanks mxf) X-Git-Tag: 4.1~139^2~3 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=761dac55143a469022f0556017126f96f2bd8c9b;p=i3%2Fi3 tests: lib/i3test: Use //= instead of unless exists $args{key} (Thanks mxf) --- diff --git a/testcases/t/lib/i3test.pm b/testcases/t/lib/i3test.pm index 87cb769d..2685d695 100644 --- a/testcases/t/lib/i3test.pm +++ b/testcases/t/lib/i3test.pm @@ -144,11 +144,11 @@ sub open_window { my $dont_map = delete $args{dont_map}; - $args{class} = WINDOW_CLASS_INPUT_OUTPUT unless exists $args{class}; - $args{rect} = [ 0, 0, 30, 30 ] unless exists $args{rect}; - $args{background_color} = '#c0c0c0' unless exists $args{background_color}; - $args{event_mask} = [ 'structure_notify' ] unless exists $args{event_mask}; - $args{name} = 'Window ' . counter_window() unless exists $args{name}; + $args{class} //= WINDOW_CLASS_INPUT_OUTPUT; + $args{rect} //= [ 0, 0, 30, 30 ]; + $args{background_color} //= '#c0c0c0'; + $args{event_mask} //= [ 'structure_notify' ]; + $args{name} //= 'Window ' . counter_window(); my $window = $x->root->create_child(%args);