Test::Async
- base module of the framework
use Test::Async;
plan 1;
pass "Hello World!";
done-testing
The module setups testing evironment for a test suite. It is intended to be used in a script implementing the suite but is not recommended for a module. See Test::Async::CookBook
for more details.
The module re-exports all symbols found in a test bundle EXPORT::DEFAULT
package.
Also exports:
Return the test suite which is actual for the current context. The suite is looked up either in $*TEST-SUITE
or via Test::Async::Hub
top-suite
method.
A quick way to turn a routine
into test tool. This means, in particular, that for test tools, invoked from within the routine, any error would be reported as if it is the test assertions flunked. For example, for the following test suite:
1: use Test::Async;
2: sub flunk-me(Str:D $message) is test-assertion {
3: subtest $message, :hidden, {
4: pass "oki";
5: flunk "I'm intentionally bad"
6: }
7: }
8: test-flunks "we need to see where it flunks";
9: subtest "Flunking" => {
10: flunk-me "need to.";
11: }
The output would contain something like:
# Failed test 'need to.'
# at ...test-suite-path... line 10
The above example also uses the recommended practive of using a test assertion where, whenever it is calling 2 or more test tools, a :hidden
subtest
would be wrapping around them in order to create common context.
The module exports all test tools it finds in the top suite object. See Test::Async::Manual
for more details.
(c) 2020-2023, Vadim Belman [email protected]
Artistic License 2.0
See the LICENSE file in this distribution.