4 #use UNIVERSAL qw/isa/;
7 our %tests = ( clone_name_with_chromosome
=> [
15 match
=> 'SGN12H032K07',
27 match
=> 'C11HBa119D16',
39 match
=> 'C02HBa0155C04',
44 [ 'C02HBa0155C04.3-87',
51 match
=> 'C02HBa0155C04.3-87',
67 seqwright_bac_chromat_file
=> [
68 [ 'tomato_genome/bac_ends/Le-HBa001_A01-T7.ab1.gz',
74 path
=> 'tomato_genome/bac_ends/',
77 filename
=> 'Le-HBa001_A01-T7',
78 match
=> 'Le-HBa001_A01-T7',
81 [ '/bac_ends/SL_MboI_1_A05-SP6.g',
90 filename
=> 'SL_MboI_1_A05-SP6.g',
91 match
=> 'SL_MboI_1_A05-SP6',
95 genbank_accession
=> [
126 #[ NE999999 => undef ],
130 use Test
::More qw
/no_plan/;
132 use_ok
('CXGN::Genomic::CloneNameParser');
134 my $parser = CXGN
::Genomic
::CloneNameParser
->new;
135 isa_ok
($parser,'CXGN::Genomic::CloneNameParser' ,'CloneNameParser constructor works');
137 #test each clone name parser function jimmy
138 foreach my $funcname (keys our %tests) {
139 foreach my $test (@
{$tests{$funcname}}) {
140 #pretty-print the expected return value
141 my $exp_str = hashref_to_str
($test->[1]);
143 my $ret = $parser->$funcname( $test->[0] );
145 ok
( eq_hash
( $ret, $test->[1] ),"$funcname('$test->[0]')")
146 or diag
"expected $exp_str\ngot ".hashref_to_str
($ret)."\n";
153 if ( defined($ref) ) {
154 ref $ref eq 'HASH' or die 'not a hash ref';
157 foreach my $key (sort keys %$ref) {
158 my $val = $ref->{$key};
159 $val = 'undef' unless defined($val);
160 push @strs, "$key => $val";
162 return join(', ',@strs);