continued doc and testing drive; rationalize GraphML a little
[scpubgit/stemmatology.git] / t / text_tradition_parser_collatex.t
CommitLineData
e867486f 1#!/usr/bin/perl -w
2
3use strict;
4use Test::More 'no_plan';
5$| = 1;
6
7
8
9# =begin testing
10{
11use Text::Tradition;
12binmode STDOUT, ":utf8";
13binmode STDERR, ":utf8";
14eval { no warnings; binmode $DB::OUT, ":utf8"; };
15
16my $cxfile = 't/data/Collatex-16.xml';
17my $t = Text::Tradition->new(
18 'name' => 'inline',
19 'input' => 'CollateX',
20 'file' => $cxfile,
21 );
22
23is( ref( $t ), 'Text::Tradition', "Parsed our own GraphML" );
24if( $t ) {
25 is( scalar $t->collation->readings, 26, "Collation has all readings" );
26 is( scalar $t->collation->paths, 49, "Collation has all paths" );
27 is( scalar $t->witnesses, 3, "Collation has all witnesses" );
28
29 # Check an 'identical' node
30 my $transposed = $t->collation->reading( 'n15' );
31 ok( $transposed->has_primary, "Reading links to transposed primary" );
32 is( $transposed->primary->name, 'n17', "Correct transposition link" );
33}
34}
35
36
37
38
391;