Skip to content

Instantly share code, notes, and snippets.

View exodist's full-sized avatar

Chad Granum exodist

View GitHub Profile
use strict;
use warnings;
use Test::More;
use Scalar::Util qw/reftype/;
sub redact {
my ($thing, $replace, @fix) = @_;
my %seen;
my @stack = ($thing);
while (@stack) {
use strict;
use warnings;
use B;
sub simple {
print "A";
@exodist
exodist / test.pl
Created October 21, 2015 20:50
pure perl Sub::Name, mostly
use strict;
use warnings;
use Carp qw/longmess/;
use B;
my @STASH;
sub set_sub_name {
my ($name, $sub) = @_;
@exodist
exodist / clever.pl
Created October 22, 2015 05:21
What will this print? clever!
use strict;
use warnings;
my $count = 4;
while (1) {
print "loop: " . (5 - $count) . "\n";
no warnings 'void';
$count-- xor next if $count;
@exodist
exodist / test.pl
Created October 22, 2015 15:43
Sub::Uplevel vs goto
use strict;
use warnings;
package uplevel;
use Sub::Uplevel;
use Carp qw/cluck/;
#line 10
sub a { cluck "XXX" };
sub b { a('a') }
@exodist
exodist / test.pl
Created October 22, 2015 18:29
LOL
use strict;
use warnings;
package aaa;
sub foo { print "A\n" }
package aab;
sub foo { print "B\n" }
package main;
use Test::Stream -V1;
is(
[
{a => 1, b => 2},
"x"
],
[
{a => "one", b => "two"},
"y"
],
<Exodist> https://metacpan.org/pod/distribution/Test-Stream/lib/Test/Stream/Manual/FromTestBuilder.pod
was updated to reference the -Classic bundle, is_deeply and classic 'is' are int he classic bundle.
also cmp_ok is back.
<Exodist> let them chill on git for a week, then put them in a trial for a few days, now they are out.
<rjbs> github and chill
<Exodist> haha
<mohawk> well played!
[...]
<jberger> rjbs: I hope you're using (ssl) protection
@exodist
exodist / OO.pm
Created November 13, 2015 20:22
Test::Stream::Plugin::OO
package Test::Stream::Plugin::OO;
use strict;
use warnings;
use Carp qw/confess croak/;
use Test::Stream::Plugin;
use Test::Stream::Plugin::OO::Base;
use Test::Stream::Util qw/pkg_to_file/;
@exodist
exodist / test.pl
Created November 23, 2015 21:49
perofrmance
use strict;
use warnings;
use Time::HiRes qw/time/;
use Scalar::Util qw/blessed/;
use List::Util qw/max/;
my $runs = 1_000_000;