sort-of-fix some tests
[scpubgit/stemmatology.git] / t / stemma.t
1 #!/usr/bin/perl
2
3 use strict; use warnings;
4 use Test::More;
5 use lib 'lib';
6 use Text::Tradition;
7 use Text::Tradition::Stemma;
8 use XML::LibXML;
9 use XML::LibXML::XPathContext;
10
11 my $datafile = 't/data/Collatex-16.xml'; #TODO need other test data
12
13 my $tradition = Text::Tradition->new( 
14     'name'  => 'inline', 
15     'input' => 'CollateX',
16     'file'  => $datafile,
17     );
18 my $stemma = Text::Tradition::Stemma->new( 'collation' => $tradition->collation );
19
20 # Test for object creation
21 ok( $stemma->isa( 'Text::Tradition::Stemma' ), 'Got the right sort of object' );
22
23 # Test for character matrix creation
24 $stemma->make_character_matrix();
25  ## check number of rows
26  ## check number of columns
27
28 # Test that pars runs
29 my( $status, $tree ) = $stemma->run_phylip_pars();
30 ok( $status, "pars ran successfully" );
31 print STDERR "Error was $tree\n" unless $status;
32
33 # Test that we get a tree
34
35 # Test that the tree has all our witnesses
36
37 done_testing();