Sha256: 7284604419d9977f77f1b8063de1fd7c00c10d35d3be3e093808c721d97988ec
Contents?: true
Size: 982 Bytes
Versions: 73
Compression:
Stored size: 982 Bytes
Contents
#!/usr/bin/env perl use strict; use warnings; use Test::More; use FindBin; my $dir; BEGIN { $dir = $FindBin::Bin . '/' }; use lib $dir; my $module = 'DNA'; my @cases = ( ['C', 'G', 'cytosine unchanged'], ['G', 'C', 'guanine unchanged'], ['T', 'A', 'adenine unchanged'], ['A', 'U', 'thymine to uracil'], ['ACGTGGTCTTAA', 'UGCACCAGAAUU', 'transcribes all occurences'], ); plan tests => 3 + @cases; ok -e "${dir}${module}.pm", "missing $module.pm" or BAIL_OUT("You need to create a module called $module.pm with a function called to_rna() that gets one parameter: a DNA sequence"); eval "use $module"; ok !$@, "Cannot load $module.pm" or BAIL_OUT("Does $module.pm compile? Does it end with some true value?"); can_ok($module, 'to_rna') or BAIL_OUT("Missing package $module; or missing sub to_rna"); my $sub = $module . '::to_rna'; foreach my $c (@cases) { no strict 'refs'; is $sub->($c->[0]), $c->[1], "$c->[2]: $c->[0] => $c->[1]"; }
Version data entries
73 entries across 73 versions & 1 rubygems