File: handlers2.x

package info (click to toggle)
libdata-stag-perl 0.13-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,428 kB
  • ctags: 727
  • sloc: perl: 6,394; lisp: 141; xml: 116; ansic: 55; makefile: 17; sh: 2
file content (32 lines) | stat: -rw-r--r-- 626 bytes parent folder | download | duplicates (5)
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
use lib 't';

BEGIN {
    # to handle systems with no installed Test module
    # we include the t dir (where a copy of Test.pm is located)
    # as a fallback
    eval { require Test; };
    use Test;    
    plan tests => 9;
}
use Data::Stag qw(:all);
use Data::Stag::BaseGenerator;
use FileHandle;

my $p = Data::Stag::BaseGenerator->new;
my $h = Data::Stag->getformathandler('sxpr');
$p->handler($h);

sub go {
    my $p = shift;
    $p->start_event('foo');
    $p->evbody('');
    $p->event(bar=>'1');
    $p->end_event('foo');
}

go($p);

$p = Data::Stag::BaseGenerator->new;
go($p);
print stag_xml($p->handler->tree);