Test::Future::AsyncAwait::Awaitable(3pm) | User Contributed Perl Documentation | Test::Future::AsyncAwait::Awaitable(3pm) |
"Test::Future::AsyncAwait::Awaitable" - conformance tests for awaitable role API
use Test::More; use Test::Future::AsyncAwait::Awaitable; use My::Future::Subclass; test_awaitable "My subclass of Future", class => "My::Future::Subclass"; done_testing;
This module provides a single test function, which runs a suite of subtests to check that a given class provides a useable implementation of the Future::AsyncAwait::Awaitable role. It runs tests that simulate various ways in which Future::AsyncAwait will try to use an instance of this class, to check that the implementation is valid.
test_awaitable( $title, %args )
Runs the API conformance tests. $title is printed in the test description output so should be some human-friendly string.
Takes the following named arguments:
This argument is optional; if not provided the tests will simply try to invoke the regular "new" constructor on the given class name. For most implementations this should be sufficient.
$f = $new->()
$cancel->( $f )
$force->( $f )
Paul Evans <leonerd@leonerd.org.uk>
2024-04-01 | perl v5.38.2 |