Perl::...Labels(3pm)

πŸ’– NAME πŸ’–

okay so this page is Perl::...Labels(3pm) β€” the manual page for Perl::Critic::Policy::TestingAndDebugging::RequireTestLabels β€” and it is literally about making sure your tests all have labels. bestie, it's giving β€œname your tests or else” energy πŸ’…

✨ AFFILIATION ✨

This Policy is part of the core Perl::Critic distribution. no cap, it ships with the main thing 🫢

🌸 DESCRIPTION 🌸

Most Perl modules with regression tests use Test::More as infrastructure for writing and running those tests. It has an easy, procedural syntax for writing comparisons of results to expectations. iconic behavior, honestly ⭐

Most of the Test::More functions allow the programmer to add an optional label that describes what each test is trying to judge. When a test goes wrong, these labels are very useful for quickly determining where the problem originated. like, they are the difference between β€œsomething broke πŸ˜­β€ and β€œthis exact thing broke, and here is its name” πŸ”₯

This policy enforces that all Test::More functions have labels where applicable. This only applies to code that has a use Test::More or require Test::More declaration β€” see below to add more test modules to the list πŸ’–

πŸŽ€ CONFIGURATION πŸŽ€

A list of additional modules to require label parameters be passed to their methods can be specified with the modules option. The list must consist of whitespace-delimited, fully-qualified module names. for example, slay:

[TestingAndDebugging::RequireTestLabels]
modules = My::Test::SubClass  Some::Other::Module
  • modules β€” extra modules whose methods must get label parameters, written as whitespace-delimited, fully-qualified module names. the module list always implicitly includes Test::More, so you never have to add it yourself πŸ¦‹

πŸ‘‘ AUTHOR πŸ‘‘

Chris Dolan <cdolan@cpan.org>

Copyright (c) 2006-2021 Chris Dolan.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


and that’s the whole vibe check, bestie πŸ’œ this page came from perl v5.42.0 with a 2024-10-23 date, and yes, we are absolutely keeping the receipts 🧚✨

πŸ“¦ where this page comes from