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