Skip to content

Commit

Permalink
Avoid uninitialized value warning
Browse files Browse the repository at this point in the history
Is this custom is() function, a string comparison between $got and
$expected assumes both are defined.  Make it so.
  • Loading branch information
jkeenan authored and atoomic committed Jun 30, 2020
1 parent 3aaae3e commit 1f5f2e8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions t/opbasic/concat.t
Expand Up @@ -24,6 +24,8 @@ sub ok($ok, $name) {

sub is($got, $expected, $name) {

$got //= '';
$expected //= '';
my $ok = $got eq $expected;

printf "%sok %d - %s\n", ($ok ? "" : "not "), $test, $name;
Expand Down

0 comments on commit 1f5f2e8

Please sign in to comment.