4 use Test::More 'no_plan';
12 binmode STDOUT, ":utf8";
13 binmode STDERR, ":utf8";
14 eval { no warnings; binmode $DB::OUT, ":utf8"; };
16 my $par_seg = 't/data/florilegium_tei_ps.xml';
17 my $t = Text::Tradition->new(
23 is( ref( $t ), 'Text::Tradition', "Parsed parallel-segmentation TEI" );
25 is( scalar $t->collation->readings, 311, "Collation has all readings" );
26 is( scalar $t->collation->paths, 361, "Collation has all paths" );
29 # Try to re-parse it, ensure we can use the parser twice in the same Perl
32 my $t2 = Text::Tradition->new(
38 is( ref( $t2 ), 'Text::Tradition', "Parsed parallel-segmentation TEI again" );
46 use XML::LibXML::XPathContext;
47 use Text::Tradition::Parser::TEI;
49 my $xml_str = '<tei><rdg wit="#A #B #C #D">some text</rdg></tei>';
50 my $el = XML::LibXML->new()->parse_string( $xml_str )->documentElement;
51 my $xpc = XML::LibXML::XPathContext->new( $el );
52 my $obj = $xpc->find( '//rdg' );
54 my @wits = Text::Tradition::Parser::TEI::_get_sigla( $obj );
55 is( join( ' ', @wits) , "A B C D", "correctly parsed reading wit string" );