Result

NAME

Test::Async::Result - test result representation

SYNOPSIS

self.proclaim: test-result(
                    $condition, 
                    fail => {
                        comments => "a comment about the cause of flunk",
                    });

DESCRIPTION

This class represents information about test outcomes.

ATTRIBUTES

Bool:D $.cond

True if test is considered success, False otherwise. Note that a skipped tests is a success.

$.fail-profile, $.success-profile

Profiles to be used to create a new Event::Test object. Depending on $.cond value either success- or fail-profile is used. The most typical use of this is to add comments explaining the test outcome.

A profile attribute can be made lazy if assigned with a code object:

my $tr = test-result($condition, fail => -> { comments => self.expected-got($expected, $got) });

In this case event-profile method will invoke the code and use the return value as profile itself. This improves performance in cases when profile keys are set using some rather heavy code (like the expected-got method in the example above) but eventually might not even be used after all.

METHODS

event-profile(-- Capture:D)>

Returns a profile accordingly to $.cond.

The profile capture is built the following way:

  • if corresponding profile attribute is code then the code is invoked and return value is used

  • profile is coerced into a hash

  • all hash values are deconted

  • the result is coerced into Capture

Deconting of the values is done to solve some cases of improper initialization of Event attributes.

SEE ALSO

test-result routine from Test::Async::Utils.

AUTHOR

Vadim Belman [email protected]

Test::Async v0.0.16

Thread-safe testing framework

Authors

  • Vadim Belman

License

Artistic-2.0

Dependencies

Test Dependencies

Provides

  • Test::Async
  • Test::Async::Aggregator
  • Test::Async::Base
  • Test::Async::Decl
  • Test::Async::Event
  • Test::Async::Hub
  • Test::Async::Job
  • Test::Async::JobMgr
  • Test::Async::Metamodel::BundleClassHOW
  • Test::Async::Metamodel::BundleHOW
  • Test::Async::Metamodel::HubHOW
  • Test::Async::Metamodel::ReporterHOW
  • Test::Async::Reporter
  • Test::Async::Reporter::TAP
  • Test::Async::Result
  • Test::Async::TestTool
  • Test::Async::Utils
  • Test::Async::When
  • Test::Async::X

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.