# Before `make install' is performed this script should be runnable with # `make test'. ######################### use lib qw(t/lib); use Test::Simple tests => 1 ; use XML::DocStats; my $xml = < This is text Hello, world!]]> &anentity;That's an entity. XML my $report=<Hello, world!' myelement withan='entity' ENTITY: 'anentity' TEXT: myelement 'That's an entity.' TOTALS: 2 ATTRIBUTE, 1 CDATA, 1 COMMENT, 1 DOCTYPE, 4 ELEMENT, 1 ENTITY, 1 PI, 3 TEXT, 1 XML-DCL ELEMENTS: 1 anotherone, 2 myelement, 1 start ATTRIBUTES: 1 atthe, 1 withan ATTRVALUES: 1 'beginning', 1 'entity' ENTITIES: 1 anentity REPORT my $parse = XML::DocStats->new(xmlsource=>{String => $xml}); my @report = split/\n/,$parse->analyze(format=>'text',output=>'return'); pop @report; shift @report; ok( $report eq join("\n",@report)."\n" , 'parses and reports text correctly' ); #########################