Test2::...lanning(3)

πŸ“¦ version 1.302214, in opensuse-leap 16.0

πŸŽ€ NAME πŸŽ€

okay so bestie, this is the Test2::Manual::Testing::Planning(3) page β€” User Contributed Perl Documentation edition β€” and it is literally about The many ways to set a plan. no cap, that is the whole vibe. πŸ’–


🌸 DESCRIPTION 🌸

This tutorial covers the many ways of setting a plan, group-chat style. we are covering every route, and yes, it is giving organized. ✨

🧚 TEST COUNT 🧚

The plan() function is provided by Test2::Tools::Basic. It lets you specify an exact number of tests to run β€” you can do this at the start of testing or at the end. You cannot do it partway through testing, bestie. That is the rule. πŸ’…

use Test2::Tools::Basic;
plan(10); # 10 tests expected

...

πŸ¦‹ DONE TESTING πŸ¦‹

The done_testing() function is provided by Test2::Tools::Basic. It automatically sets the plan to the number of tests that were run. This must be used at the very end of testing. periodt. 🫢

use Test2::Tools::Basic;

...

done_testing();

πŸ’€ SKIP ALL πŸ’€

The skip_all() function is provided by Test2::Tools::Basic. It sets the plan to 0 and exits the test immediately. You may provide a skip reason that explains why the test should be skipped. iconic, honestly. πŸŽ€

use Test2::Tools::Basic;
skip_all("This test will not run here") if ...;

...

πŸ”₯ CUSTOM PLAN EVENT πŸ”₯

A plan is simply a Test2::Event::Plan event that gets sent to the current hub. You can always write your own tool to set the plan β€” main character energy. πŸ‘‘

use Test2::API qw/context/;

sub set_plan {
    my $count = @_;

    my $ctx = context();
    $ctx->send_event('Plan', max => $count);
    $ctx->release;

    return $count;
}

πŸ¦‹ SEE ALSO πŸ¦‹

  • Test2::Manual β€” Primary index of the manual.

🌈 SOURCE 🌈

The source code repository for Test2-Manual can be found at https://github.com/Test-More/test-more/.

πŸ‘‘ MAINTAINERS πŸ‘‘

  • Chad Granum <exodist@cpan.org>

πŸ’œ AUTHORS πŸ’œ

  • Chad Granum <exodist@cpan.org>

Copyright Chad Granum <exodist@cpan.org>.

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

See http://dev.perl.org/licenses/


πŸ’– okay that is the whole page, bestie β€” perl v5.42.0, dated 2025-07-28, manual Test2::...lanning(3). bye, slay! 🫢

πŸ“¦ where this page comes from