Test2::Event::Fail(3pm) Perl Programmers Reference Guide Test2::Event::Fail(3pm)

# [NAME](#NAME)

Test2::Event::Fail - Event for a simple failed assertion

# [DESCRIPTION](#DESCRIPTION)

This is an optimal representation of a failed assertion.

# [SYNOPSIS](#SYNOPSIS)

```
    use Test2::API qw/context/;
    sub fail {
        my ($name) = @_;
        my $ctx = context();
        $ctx->fail($name);
        $ctx->release;
    }
```

# [SOURCE](#SOURCE)

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

# [MAINTAINERS](#MAINTAINERS)

[Chad Granum &lt;exodist@cpan.org&gt;](#Chad)

# [AUTHORS](#AUTHORS)

[Chad Granum &lt;exodist@cpan.org&gt;](#Chad~2)

# [COPYRIGHT](#COPYRIGHT)

Copyright Chad Granum &lt;exodist@cpan.org&gt;.

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

See &lt;https://dev.perl.org/licenses/&gt;

2026-08-31 perl v5.44.0

---

Document: Test2::Event::Fail(3pm) from perl 5.44.0-r1 (Chainguard OS)
Source: https://github.com/Perl/perl5.git
