Test-Stream

 view release on metacpan or  search on metacpan

lib/Test/Stream/Plugin/Classic.pm  view on Meta::CPAN


use Test::Stream::Compare qw/-all/;
use Test::Stream::Context qw/context/;
use Test::Stream::Util qw/rtype render_ref protect/;

use Test::Stream::Compare::String();
use Test::Stream::Compare::Pattern();

use Test::Stream::Plugin::Compare();

sub is($$;$@) {
    my ($got, $exp, $name, @diag) = @_;
    my $ctx = context();

    my @caller = caller;

    my $delta = compare($got, $exp, \&is_convert);

    if ($delta) {
        $ctx->ok(0, $name, [$delta->table, @diag]);
    }

lib/Test/Stream/Plugin/Compare.pm  view on Meta::CPAN

use Test::Stream::Compare::Pattern();
use Test::Stream::Compare::Ref();
use Test::Stream::Compare::Regex();
use Test::Stream::Compare::Scalar();
use Test::Stream::Compare::Set();
use Test::Stream::Compare::String();
use Test::Stream::Compare::Undef();
use Test::Stream::Compare::Value();
use Test::Stream::Compare::Wildcard();

sub is($$;$@) {
    my ($got, $exp, $name, @diag) = @_;
    my $ctx = context();

    my $delta = compare($got, $exp, \&strict_convert);

    if ($delta) {
        $ctx->ok(0, $name, [$delta->table, @diag]);
    }
    else {
        $ctx->ok(1, $name);

lib/Test/Stream/Plugin/Core.pm  view on Meta::CPAN

}

sub fail {
    my ($name, @diag) = @_;
    my $ctx = context();
    $ctx->ok(0, $name, \@diag);
    $ctx->release;
    return 0;
}

sub ok($;$@) {
    my ($bool, $name, @diag) = @_;
    my $ctx = context();
    $ctx->ok($bool, $name, \@diag);
    $ctx->release;
    return $bool ? 1 : 0;
}

sub ref_is($$;$@) {
    my ($got, $exp, $name, @diag) = @_;
    my $ctx = context();

profiling/ok_stream_ipc.t  view on Meta::CPAN

use warnings;
use Test::Stream::IPC;
use Test::Stream::Context qw/context/;

sub plan {
    my $ctx = context();
    $ctx->plan(@_);
    $ctx->release;
}

sub ok($;$) {
    my ($bool, $name) = @_;
    my $ctx = context();
    $ctx->ok($bool, $name);
    $ctx->release;
}

my $count = 100000;
plan($count);

ok(1, "an ok") for 1 .. $count;

t/acceptance/try_it_done_testing.t  view on Meta::CPAN


sub done_testing {
    my $ctx = context();
    my $state = $ctx->hub->state;

    die "Test Already ended!" if $state->ended;
    $ctx->hub->finalize($ctx->debug, 1);
    $ctx->release;
}

sub ok($;$) {
    my ($bool, $name) = @_;
    my $ctx = context();
    $ctx->ok($bool, $name);
    $ctx->release;
}

ok(1, "First");
ok(1, "Second");

done_testing;

t/acceptance/try_it_no_plan.t  view on Meta::CPAN

use warnings;

use Test::Stream::Context qw/context/;

sub plan {
    my $ctx = context();
    $ctx->plan(@_);
    $ctx->release;
}

sub ok($;$) {
    my ($bool, $name) = @_;
    my $ctx = context();
    $ctx->ok($bool, $name);
    $ctx->release;
}

plan(0, 'no_plan');

ok(1, "First");
ok(1, "Second");

t/acceptance/try_it_plan.t  view on Meta::CPAN

use warnings;

use Test::Stream::Context qw/context/;

sub plan {
    my $ctx = context();
    $ctx->plan(@_);
    $ctx->release;
}

sub ok($;$) {
    my ($bool, $name) = @_;
    my $ctx = context();
    $ctx->ok($bool, $name);
    $ctx->release;
}

plan(2);

ok(1, "First");
ok(1, "Second");

t/acceptance/try_it_todo.t  view on Meta::CPAN


sub done_testing {
    my $ctx = context();
    my $state = $ctx->hub->state;

    die "Test Already ended!" if $state->ended;
    $ctx->hub->finalize($ctx->debug, 1);
    $ctx->release;
}

sub ok($;$) {
    my ($bool, $name) = @_;
    my $ctx = context();
    $ctx->ok($bool, $name);
    $ctx->release;
}

ok(1, "First");

my $todo = Test::Stream::Sync->stack->top->set_todo('here be dragons');
ok(0, "Second");



( run in 0.851 second using v1.01-cache-2.11-cpan-524268b4103 )