File: ActiveTestTest.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 (60 lines) | stat: -rw-r--r-- 1,805 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package ActiveTestTest;

use strict;

use Test::Unit::TestCase ();
use base 'Test::Unit::TestCase';
use Test::Unit::Result;
use Test::Unit::TestSuite ();
use Success;

sub testActiveTest {
    my $self = shift;
    my $test = $self->create_active_test_suite;
    my $result = Test::Unit::Result->new;
    $test->run($result);
    $self->assert_equals(100, $result->run_count);
    $self->assert_equals(0, $result->failure_count);
    $self->assert_equals(0, $result->error_count);
}

#  sub test_active_repeated_test {
#      my $self = shift;
#      my $test = Test::Unit::RepeatedTest($self->create_active_test_suite, 5);
#      my $result = Result->new;
#      $test->run($result);
#      $self->assert_equals(500, $result->run_count);
#      $self->assert_equals(0, $result->failure_count);
#      $self->assert_equals(0, $result->error_count);
#  }

#  sub test_active_repeated_test0 {
#      my $self = shift;
#      my $test = Test::Unit::RepeatedTest($self->create_active_test_suite, 0);
#      my $result = Result->new;
#      $test->run($result);
#      $self->assert_equals(0, $result->run_count);
#      $self->assert_equals(0, $result->failure_count);
#      $self->assert_equals(0, $result->error_count);
#  }

#  sub test_active_repeated_test1 {
#      my $self = shift;
#      my $test = Test::Unit::RepeatedTest($self->create_active_test_suite, 1);
#      my $result = Result->new;
#      $test->run($result);
#      $self->assert_equals(100, $result->run_count);
#      $self->assert_equals(0, $result->failure_count);
#      $self->assert_equals(0, $result->error_count);
#  }

sub create_active_test_suite () {
    my $self = shift;
    my $suite = Test::Unit::TestSuite->new;
    for (1 .. 100) {
        $suite->add_test(Success->new("test_success"));
    }
    return $suite;
}

1;