Skip to content

Commit

Permalink
Refactor comments and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kfly8 committed Aug 14, 2024
1 parent 469d961 commit 649b8c1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions lib/Syntax/Keyword/Assert.pm
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ sub apply {
Carp::croak "Unrecognised import symbols @{[ keys %syms ]}" if keys %syms;
}

# called from Assert.xs
sub _croak {
goto &Carp::croak;
}
Expand Down
14 changes: 11 additions & 3 deletions t/01_assert.t
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use Syntax::Keyword::Assert;
subtest 'Test `assert` keyword with STRICT enabled' => sub {
like dies {
assert { 0 };
}, qr/Assertion failed/;
}, qr/\AAssertion failed/;

ok lives {
assert { 1 };
Expand All @@ -25,9 +25,17 @@ subtest 'Test `assert` keyword with STRICT enabled' => sub {
$hello->('world');
};

ok dies {
like dies {
$hello->(undef);
};
}, qr/\AAssertion failed/;

like dies {
assert {
my $x = 1;
my $y = 2;
$x + $y == 100;
};
}, qr/\AAssertion failed/, 'assert block with multiple statements';
};

done_testing;
4 changes: 2 additions & 2 deletions t/10-integration/signatures.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use Test2::V0;
use Test2::Require::Perl 'v5.38';
use Test2::Require::Perl 'v5.36';

use v5.38;
use feature qw(signatures);

BEGIN {
$ENV{PERL_STRICT} = 1;
Expand Down

0 comments on commit 649b8c1

Please sign in to comment.