perl-testing

Implements Perl test suites using Test2::V0, prove, mocking, and coverage tooling.

1|Updated Oct 11, 2025
One-click install
npx skills add https://github.com/ibytechaos/claude --skill perl-testing-ibytechaos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: perl-testing
Source: https://github.com/ibytechaos/claude/tree/main/plugins/everything-claude-code/skills/perl-testing
Command: npx skills add https://github.com/ibytechaos/claude --skill perl-testing-ibytechaos

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing reliable Perl tests requires choosing the right framework, organizing test files, mocking dependencies, and measuring coverage, which is error-prone without established patterns. ## Core Features & Use Cases - Modern Test2::V0 Patterns: Deep comparison with hash/array/bag builders, subtests, and exception testing with dies/lives. - Test Organization & Execution: Directory layout conventions, prove commands for parallel runs, and .proverc configuration. - Mocking & Coverage: Test::MockModule and Test::MockObject for isolating dependencies, plus Devel::Cover for coverage reports with CI thresholds. - Use Case: When building a new Perl module, follow the TDD red-green-refactor cycle to write failing tests first, implement minimal code, then verify with prove and check coverage before merging. ## Quick Start Write a Test2::V0 test suite for my Perl module following TDD and show me how to run it with prove.

Frequently Asked Questions about perl-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write Perl tests with Test2::V0?

Use Test2::V0 with is() for equality, subtests for grouping, and hash/array builders for deep comparison. End every test file with done_testing and run tests with prove -lv to include the lib directory.

Test2::V0 vs Test::More for Perl testing?

Test2::V0 offers richer assertions, better failure diagnostics, and extensible plugins compared to Test::More. It is backward-compatible with Test::More tests, so prefer Test2::V0 for new projects.

How do I run Perl tests in parallel with prove?

Run prove with the -j flag followed by the job count, such as prove -lr -j8 t/, to execute tests across eight parallel workers. Add --state=failed to rerun only previously failing tests.

How do I mock a Perl module in tests?

Use Test::MockModule to override methods on a target package, for example $mock->mock(fetch_user => sub { ... }). The mock restores automatically when the object goes out of scope, preventing leakage between tests.

Why does prove fail with 'Can't locate module in @INC'?

This happens when prove runs without the -l flag, so modules in the lib/ directory are not added to @INC. Always run prove -l t/ or configure -l in your .proverc file.

How do I measure Perl test coverage with Devel::Cover?

Run cover -test to execute the suite under coverage, then cover -report html to generate a browsable report. For CI, parse the text report and fail the build when total coverage drops below your threshold.