examples/patch100132-1

filter: Statementstmt 77.7% 7 / 9 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 83.3% 10 / 12 CC 1 SCAR 0.9
CC
1
Cov
78%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« examples/patch100132 ↑ Summary examples/patch100132-2 »
1 #!/usr/bin/perl -w
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 ▶use Experimental::Sample;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Test::Unit::Procedural;
Subroutine BEGIN: called CC=1 SCAR=2.6
7  
8 use constant DEBUG => 0;
9  
10 # code to be tested will be somewhere around here
11  
12 # define tests, set_up and tear_down
13  
14 sub test_ok_1 {
15 assert(23 == 23);
16 }
17  
18 sub test_ok_2 {
19 assert(42 == 42);
20 }
21  
22 sub test_ok_3 {
23 my $sample = new Experimental::Sample();
24 $sample->name( 'Joe' );
25 assert( 'Joe' eq $sample->name() );
26 }
27  
28 sub set_up {
29 print "hello world\n" if DEBUG;
30 }
31  
32 sub tear_down {
33 print "leaving world again\n" if DEBUG;
34 }
35  
36 # and run them
37  
38 # This will not work, as the test methods were
39 # defined in package main:
40 #
41 # create_suite( 'Experimental::Sample' );
42 # run_suite();
43 #
44 # We need to create the default suite
45 # (created from package main) to pick
46 # our test methods up - they just use the
47 # methods in Experimental::Sample ...
48  
49 create_suite();
50 run_suite();
« examples/patch100132 ↑ Summary examples/patch100132-2 »