Agent skill · affaan-m
perl-testing
Perl testing patterns using Test2::V0, Test::More, prove runner, mocking, coverage with Devel::Cover, and TDD methodology. Use when writing Perl tests with Test2::V0 or Test::More, or measuring coverage.
What it needs
About 6k tokens when loaded.
What this skill does
Perl Testing Patterns Comprehensive testing strategies for Perl applications using Test2::V0, Test::More, prove, and TDD methodology. When to Activate Writing new Perl code (follow TDD: red, green, refactor) Designing test suites for Perl modules or applications Reviewing Perl test coverage Setting up Perl testing infrastructure Migrating tests from Test::More to Test2::V0 Debugging failing Perl tests TDD Workflow Always follow the RED-GREEN-REFACTOR cycle. Test::More Fundamentals The standard Perl testing module — widely used, ships with core. Basic Assertions SKIP and TODO Test2::V0 Modern Framework Test2::V0 is the modern replacement for Test::More — richer assertions, better diagnostics, and extensible. Why Test2? Superior deep comparison with hash/array builders Better diagnostic output on failures Subtests with cleaner scoping Extensible via Test2::Tools:: plugins Backward-compatible with Test::More tests Deep Comparison with Builders Subtests Exception Testing with Test2 Test Organization and prove Directory Structure prove Commands .proverc Configuration Fixtures and Setup/Teardown Subtest Isolation Shared Test Helpers Place reusable helpers in t/lib/TestHelper.pm and load with use lib 't/lib'. Export factory functions like createtestdb(), createtempdir(), and fixturepath() via Exporter. Mocking Test::MockModule For lightweight mock objects, use Test::MockObject to create injectable test doubles with ->mock() and verify calls with ->calledok(). Coverage with Devel::Cover Running Coverage Integration Testing Use in-memory SQLite for database tests, mock HTTP::Tiny for API tests. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills affaan-m/perl-testing--554256