This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use Test2::V0; | |
ok(1); | |
$SIG{__WARN__} = sub { | |
my ($warn) = @_; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub process_and_exit { | |
my $self = shift; | |
my ($child_pid) = @_; | |
my $guard = Scope::Guard->new(sub { | |
eval { $self->_die("Scope Leak inside collector") }; | |
exit(255); | |
}); | |
my $exit = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub cli_docs { | |
my $self = shift; | |
my @forms = $self->doc_forms; | |
require App::Yath::Util; | |
require Test2::Util::Term; | |
my $width = Test2::Util::Term::term_size() - 20; | |
$width = 80 unless $width && $width >= 80; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 my $last_write = time; | |
107 $self->{stream} = sub { | |
108 my $responder = shift; | |
109 my $writer = $responder->([200, \@headers]); | |
110 | |
111 my $end = 0; | |
112 while (!$end) { | |
113 $end = $done->(); | |
114 | |
115 my $seen = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exodist@abydos main $ perl -e 'BEGIN { *foo = sub { 512 } }; my $xxx = 16; my $yyy = foo - $xxx; print "$yyy\n";' | |
512 | |
foo() instead of foo fixes it | |
exodist@abydos main $ perl -e 'BEGIN { *foo = sub { 512 } }; my $xxx = 16; my $yyy = foo() - $xxx; print "$yyy\n";' | |
496 | |
using sub() to define foo also fixes it. | |
exodist@abydos main $ perl -e 'BEGIN { *foo = sub() { 512 } }; my $xxx = 16; my $yyy = foo - $xxx; print "$yyy\n";' | |
496 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $ctx = Test2::API::context(); | |
$ctx->fail("oops"); | |
$ctx->release | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
perl test.pl | |
# Seeded srand with seed '20201123' from local date. | |
ok 1 - hi | |
# foo | |
ok 2 - thesubtest { | |
ok 1 - hi | |
# foo | |
1..1 | |
} | |
1..2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!perl xxx.pl | |
Can xxx() | |
Undefined subroutine &main::xxx called at xxx.pl line 10. | |
Undefined subroutine &main::xxx called at xxx.pl line 11. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
keyword BAREWORD_NAME(PARAMS) {BLOCK} | |
keyword "QUOTED_NAME"(PARAMS) {BLOCK} | |
Where (PARAMS) are optional. | |
For params I honestly want to just turn it into {PARAMS} treat it like a hashref definition cause it will always have key/value pairs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Test2::Plugin::Cover; | |
use strict; | |
use warnings; | |
our $VERSION = '0.000001'; | |
use XSLoader; | |
XSLoader::load(__PACKAGE__, $VERSION); | |
1; |
NewerOlder