Community

Dueling code wizardry is one of the things I love most about Perl

June 27, 2017 Community, CPAN 3 comments , , ,

At least week’s Perl Conference, Damian Conway talked about some new magical awesomeness he created, as he so frequently does. It’s Test::Expr, and it makes it easier to write tests:

# Write this ...                 ... instead of this.
ok $got eq $expected;            is        $got, $expected;
ok $got ne $unexpected;          isnt      $got, $unexpected;
ok $got == $expected;            is_deeply $got, $expected;
ok $got ~~ $expected;            unlike    $got, $pattern;
ok $got =~ $pattern;             like      $got, $pattern;
ok $got !~ $pattern;             unlike    $got, $pattern;
ok $obj->isa($classname);        is_ok     $got, $classname;
ok $obj->can($methodname);       can_ok    $obj, $methodname;

It also improves the diagnostics by showing the expression that failed.

#   Failed test '$got eq $expected'
#   at t/synopsis.t line 13.
#   because:
#          $got --> "1.0"
#     $expected --> 1

Chad Granum, the maintainer of much of Perl’s testing infrastructure took that last part as a challenge and overnight created his own magic in response: Test2::Plugin::SourceDiag.

use Test2::V0;
use Test2::Plugin::SourceDiag;

ok(0, "fail");

done_testing;

Produces the output:

not ok 1 - fail
Failure source code:
# ------------
# 4: ok(0, "fail");
# ------------
# Failed test 'fail'
# at test.pl line 4.

instead of:

not ok 1 - fail

#   Failed test 'fail'
#   at foo.t line 4.

This kind of dueling wizardry is one of the things that I love so much about Perl and its community.

Watch Chad’s lightning talk:

Perlbuzz news roundup for 2012-10-15

October 15, 2012 Community, CPAN, Perl 5, Perl 6, Rakudo No comments

These links are collected from the
Perlbuzz Twitter feed.
If you have suggestions for news bits, please mail me at
andy@perlbuzz.com.

Perlbuzz news roundup for 2012-10-09

October 9, 2012 Code craft, Community, Conferences, CPAN, Perl 5 No comments

These links are collected from the
Perlbuzz Twitter feed.
If you have suggestions for news bits, please mail me at
andy@perlbuzz.com.

Perlbuzz news roundup for 2012-09-17

September 17, 2012 Community, CPAN, Perl 5 No comments

These links are collected from the
Perlbuzz Twitter feed.
If you have suggestions for news bits, please mail me at
andy@perlbuzz.com.

Perlbuzz news roundup for 2012-08-27

August 27, 2012 Community, CPAN, Perl 5, Perl 6 No comments

These links are collected from the
Perlbuzz Twitter feed.
If you have suggestions for news bits, please mail me at
andy@perlbuzz.com.

Perlbuzz news roundup for 2012-07-30

July 30, 2012 Community, Conferences, Perl 5, Perl 6 No comments

These links are collected from the
Perlbuzz Twitter feed.
If you have suggestions for news bits, please mail me at
andy@perlbuzz.com.

Perlbuzz news roundup for 2012-07-23

July 23, 2012 Community, Conferences, CPAN, Perl 5 No comments

These links are collected from the
Perlbuzz Twitter feed.
If you have suggestions for news bits, please mail me at
andy@perlbuzz.com.

Perlbuzz news roundup for 2012-07-09

July 9, 2012 Community, Conferences, CPAN, Perl 5, Perl 6 No comments

These links are collected from the
Perlbuzz Twitter feed.
If you have suggestions for news bits, please mail me at
andy@perlbuzz.com.

Perlbuzz news roundup for 2012-06-25

June 25, 2012 Community, Conferences, CPAN No comments

These links are collected from the
Perlbuzz Twitter feed.
If you have suggestions for news bits, please mail me at
andy@petdance.com.

Perlbuzz news roundup for 2012-06-18

June 18, 2012 Community, Conferences, CPAN, Perl 5, Perl 6 No comments

These links are collected from the
Perlbuzz Twitter feed.
If you have suggestions for news bits, please mail me at
andy@perlbuzz.com.

  • Perl for Big Data: “Hadoop is overrated. Come see what modern Perl can do.” (blog.yapcna.org)
  • Why I use Perl: Reliability (modernperlbooks.com)
  • Any language would be improved if it had Perl’s testing and library culture. (news.ycombinator.com)
  • YAPC::NA 2012’s legacy for future organizers (blogs.perl.org)
  • Evolving tests and code in small steps (modernperlbooks.com)
  • mod_perl 2.07 released, works w/Perl 5.16 (blogs.perl.org)
  • HTML::Tree 5.00 fixes memory leak problems (blogs.perl.org)
  • “Our meritocracy is broken.” — @schwern at #yapcna
  • “The people who want to use Perl are those we should be building the community for.” — @schwern at #yapcna
  • Larry Wall had to hack a 25-year Perl ribbon at #yapcna. (twitter.com)
  • perlybook.org generates epub/mobi ebooks of Perl module documentation.
  • Ovid’s “Beginning Perl” available online for free (blogs.perl.org)
  • “There are no stupid questions” says Mojolicious’ @tempire. “Nobody will be mean to you in #mojo IRC channel.” Bravo for publicly stating.
  • When subgroups of your community find it necessary to say “We will not be mean to you,” your community has a Big Problem.
  • Arduino/Dancer-enabled mobile-enhanced door (blogs.perl.org)
  • Boston Ruby works to be beginner-friendly (openhatch.org)
  • Reflections on YAPC::NA 2012 (blogs.perl.org)
  • How @mithaldu put the YAPC videos on YouTube (blogs.perl.org)
  • Rakudo Perl 6 on Android (blogs.perl.org)
  • YAPC::NA recap from Sawyer_X (blogs.perl.org)
  • Calculating technical debt with Perl::Critic (elliotlovesperl.com)