# $Id: 14-nexus.t 4444 2007-08-21 13:04:36Z rvosa $ use strict; #use warnings; use Test::More tests => 5; use Bio::Phylo::IO qw(parse); #Bio::Phylo::IO->VERBOSE( -level => 1 ); # Up until the next big block of comment tokens, a number of nexus strings is # defined. ################################################################################ ################################################################################ ################################################################################ ################################################################################ # This string holds a valid (mesquite) nexus file my $testparse = < 'nexus', '-string' => $testparse ) }; if ( $@ ) { print $@->trace->as_string; die $@; } ok( parse( '-format' => 'nexus', '-string' => $testparse ), '1 good parse' ); print "--------------------------------------------------------------------\n"; ok( parse( '-format' => 'nexus', '-string' => $testparse_trees ), '2 tree block' ); print "--------------------------------------------------------------------\n"; eval { parse( '-format' => 'nexus', '-string' => $testparse_taxa_bad ) }; ok( $@->isa('Bio::Phylo::Util::Exceptions::BadFormat'), '3 bad ntax' ); print "--------------------------------------------------------------------\n"; eval { parse( '-format' => 'nexus', '-string' => $testparse_bad ) }; ok( $@->isa('Bio::Phylo::Util::Exceptions::BadFormat' ), '4 bad nchar' ); print "--------------------------------------------------------------------\n"; eval { parse( '-format' => 'nexus', '-file' => 'DOES_NOT_EXIST' ) }; ok( $@->isa('Bio::Phylo::Util::Exceptions::FileError'), '5 file error' );