Devel-Chitin

 view release on metacpan or  search on metacpan

t/lib/TestHelper.pm  view on Meta::CPAN


        context_do {
            run_subtest("subroutine_location for $subname", $subtest);
        };
    };
}

sub ok_breakpoint {
    my %params = @_;

    my($file, $from_line) = (caller)[1, 2];
    $params{file} = $file unless exists ($params{file});
    my $bp_line = $params{line};

    my $subtest = sub {
        my @bp = Devel::Chitin::Breakpoint->get(%params);
        if (@bp != 1) {
            fail("Expected 1 breakpoint in ok_breakpoint($from_line), but got ".scalar(@bp));
        }

        ok($bp[0], 'Got breakpoint');

t/lib/TestHelper.pm  view on Meta::CPAN

        }
    };
    push @TEST_QUEUE, sub {
        context_do {
            run_subtest("breakpoint($from_line) ${file}:${bp_line}", $subtest);
        }
    };
}

sub ok_at_end {
    my $from_line = (caller)[2];

    my $test = sub {
        context_do {
            my $ctx = shift;
            $ctx->ok($AT_END, "at_end($from_line)");
        };

        __PACKAGE__->disable_debugger if (! @TEST_QUEUE and $AT_END);
    };
    push @TEST_QUEUE, $test;
}

sub ok_breakable {
    my($file, $line) = @_;
    my $from_line = (caller)[2];

    my $test = sub {
        context_do {
            my $ctx = shift;
            $ctx->ok( __PACKAGE__->is_breakable($file, $line), "${file}:${line} is breakable");
        };
    };
    push @TEST_QUEUE, $test;
}

t/lib/TestHelper.pm  view on Meta::CPAN

            $ctx->ok( __PACKAGE__->add_watchexpr($expr), $comment);
        };
    };
    push @TEST_QUEUE, $test;
}

sub ok_set_action {
    my $comment = pop;
    my %params = @_;

    $params{file} = (caller)[1] unless exists $params{file};

    my $test = sub {
        context_do {
            my $ctx = shift;
            $ctx->ok( Devel::Chitin::Action->new(%params), $comment);
        };
    };
    push @TEST_QUEUE, $test;
}

sub ok_set_breakpoint {
    my $comment = pop;
    my %params = @_;

    $params{file} = (caller)[1] unless exists $params{file};

    my $test = sub {
        context_do {
            my $ctx = shift;
            $ctx->ok( Devel::Chitin::Breakpoint->new(%params), $comment);
        };
    };
    push @TEST_QUEUE, $test;
}



( run in 2.391 seconds using v1.01-cache-2.11-cpan-1e74a51a04c )