File: patch100132-1

package info (click to toggle)
libtest-unit-perl 0.27-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,312 kB
  • sloc: perl: 4,297; makefile: 5
file content (50 lines) | stat: -rw-r--r-- 857 bytes parent folder | download | duplicates (7)
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
#!/usr/bin/perl -w

use strict;

use Experimental::Sample;
use Test::Unit::Procedural;

use constant DEBUG => 0;

# code to be tested will be somewhere around here

# define tests, set_up and tear_down

sub test_ok_1 {
	assert(23 == 23);
}

sub test_ok_2 {
	assert(42 == 42);
}

sub test_ok_3 {
	my $sample = new Experimental::Sample();
        $sample->name( 'Joe' );
	assert( 'Joe' eq $sample->name() );
}

sub set_up {
	print "hello world\n" if DEBUG;
}

sub tear_down {
	print "leaving world again\n" if DEBUG;
}

# and run them

# This will not work, as the test methods were
# defined in package main:
#
# create_suite( 'Experimental::Sample' );
# run_suite();
#
# We need to create the default suite 
# (created from package main) to pick 
# our test methods up - they just use the
# methods in Experimental::Sample ...

create_suite();
run_suite();