Skip to content

Commit

Permalink
stabilize tests
Browse files Browse the repository at this point in the history
  • Loading branch information
demerphq committed Aug 27, 2022
1 parent fa87ac1 commit 1502965
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions t/comp/retainedlines.t
Expand Up @@ -55,7 +55,10 @@ sub check_retained_lines {
# Is there a more efficient way to write this?
my @expect_lines = (undef, map ({"$_\n"} split "\n", $prog), "\n", ';');

my @keys = grep {!$seen{$_}} grep { /eval/ } keys %::;
my @keys = map { $_->[0] }
sort { $b->[1] <=> $a->[1] }
map { (/eval (\d+)/ && !$seen{$_}) ? [ $_, $1 ] : () }
keys %::;

is ((scalar @keys), 1, "1 new eval");

Expand All @@ -67,7 +70,7 @@ sub check_retained_lines {
for (0..$#expect_lines) {
is ($got_lines[$_], $expect_lines[$_], "Line $_ is correct");
}
$seen{$keys[0]}++;
$seen{$_}++ for @keys;
}

my $name = 'foo';
Expand Down

0 comments on commit 1502965

Please sign in to comment.