File: BadSuitesTest.pm

package info (click to toggle)
libtest-unit-perl 0.28-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,312 kB
  • sloc: perl: 4,299; makefile: 5
file content (28 lines) | stat: -rw-r--r-- 614 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package BadSuitesTest;

use strict;

use Test::Unit::TestCase;
use Test::Unit::TestRunner;

use base 'Test::Unit::TestCase';

sub test_suite_with_syntax_error {
    my $self = shift;
    my $runner = Test::Unit::TestRunner->new();
    eval {
        $runner->start('BadSuite::SyntaxError');
    };
    $self->assert(qr!^syntax error at .*/SyntaxError\.pm!, "$@");
}

sub test_suite_with_bad_use {
    my $self = shift;
    my $runner = Test::Unit::TestRunner->new();
    eval {
        $runner->start('BadSuite::BadUse');
    };
    $self->assert(qr!^Can't locate TestSuite/NonExistent\.pm in \@INC!, "$@");
}

1;