]> git.sur5r.net Git - i3/i3/commitdiff
i3test: get rid of the smartmatch operator, it’s experimental since perl 5.18
authorMichael Stapelberg <michael@stapelberg.de>
Tue, 24 Sep 2013 04:35:51 +0000 (06:35 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Tue, 24 Sep 2013 04:35:51 +0000 (06:35 +0200)
testcases/lib/i3test.pm

index 9f3a6ea2d0be346be4363dd074c8cac69a19a8cd..476cda03e732d656bbc68f7f1c6feb95fc05afbf 100644 (file)
@@ -406,7 +406,7 @@ C<fresh_workspace> which directly switches to an unused workspace.
 sub get_unused_workspace {
     my @names = get_workspace_names();
     my $tmp;
-    do { $tmp = tmpnam() } while ($tmp ~~ @names);
+    do { $tmp = tmpnam() } while ((scalar grep { $_ eq $tmp } @names) > 0);
     $tmp
 }
 
@@ -626,7 +626,7 @@ Returns true if C<$workspace> is the name of an existing workspace.
 =cut
 sub workspace_exists {
     my ($name) = @_;
-    ($name ~~ @{get_workspace_names()})
+    (scalar grep { $_ eq $name } @{get_workspace_names()}) > 0;
 }
 
 =head2 focused_ws