1 |
williamc |
1.1 |
#
|
2 |
|
|
# Parse test suite
|
3 |
|
|
#
|
4 |
|
|
|
5 |
|
|
package ActiveDoc::test::test_Parse;
|
6 |
|
|
require 5.001;
|
7 |
|
|
@ISA = ("TestClass"); #methods both from the test class
|
8 |
|
|
|
9 |
|
|
sub init {
|
10 |
|
|
my $self=shift;
|
11 |
|
|
$self->{testfile}=$self->datadir()."/ParseTest";
|
12 |
|
|
}
|
13 |
|
|
|
14 |
|
|
sub test {
|
15 |
|
|
my $self=shift;
|
16 |
|
|
|
17 |
|
|
# -- addtag test
|
18 |
|
|
$self->newobject("");
|
19 |
|
|
$self->testinterface(qw(addtag Test),\&Test_start,$self,"",$self,\&Test_end, $self);
|
20 |
|
|
$self->{testtag}=0;
|
21 |
|
|
$self->testinterface("parse",$self->{testfile});
|
22 |
|
|
if ( $self->{testtag}==1 ) {
|
23 |
|
|
$self->testpass("Test tag reached OK");
|
24 |
|
|
}
|
25 |
|
|
else {
|
26 |
|
|
$self->testfail("Failed to reach Test tag");
|
27 |
|
|
}
|
28 |
|
|
}
|
29 |
|
|
|
30 |
|
|
# ----- Tag routines
|
31 |
|
|
sub Test_start {
|
32 |
|
|
my $self=shift;
|
33 |
|
|
my $name=shift;
|
34 |
|
|
my $hashref=shift;
|
35 |
|
|
|
36 |
|
|
print "Test start tag <".$name."> called\n";
|
37 |
|
|
$self->{testtag}=1;
|
38 |
|
|
|
39 |
|
|
}
|
40 |
|
|
sub Test_end {
|
41 |
|
|
my $self=shift;
|
42 |
|
|
my $name=shift;
|
43 |
|
|
my $hashref=shift;
|
44 |
|
|
|
45 |
|
|
print "Test end tag </".$name."> called\n";
|
46 |
|
|
|
47 |
|
|
}
|
48 |
|
|
|