#!perl -w use strict; # test functions package main; use Test::More tests => 3; # use SeqFun qw/:all/; { BEGIN { use_ok('SeqFun', qw/:all/); } # set up data my $sequence = "throwawayslurp.data"; my $data = ' AGCTAGCTCATCATCATCATTAGBAGDADTATGAGCGCAAAAAAAA BADBADGGGGCCCCATATATATATATATATAAAAAAAAAAAAAAAA '; open(FILE, "> $sequence") or die("Unable to write: $sequence: $!"); print FILE $data; close(FILE); # run tests my $slurp = slurp($sequence); is($$slurp,$data,"Test data written with data read by slurp"); # Clean up any test files unlink($sequence) or die("Unable to delete $sequence: $!"); my $text = count($sequence,$slurp); # note the use of tab as \t and newline as \n # These are hard to spot in testing # I let the test tell me the answers: # is($text,"tell me", "Test of counts and output"); is($text,"throwawayslurp.data:\tA=45 C=12 G=11 T=17 errors=7\n", "Test of counts and output"); # successful exit exit (0); }