Merge pull request #522 from mwmiller/empty_reverse

Reverse: add guard against empty remainder.
master
Jag Talon 2014-07-01 09:17:10 -04:00
commit d4ae639ddb
2 changed files with 2 additions and 0 deletions

View File

@ -19,6 +19,7 @@ zci answer_type => "reverse";
handle remainder => sub {
return unless $_; # Guard against empty query.
#Filter out requests for DNA/RNA reverse complements, handled
# by the ReverseComplement goodie
return if $_ =~ /^complement\s(of )?[ATCGURYKMSWBVDHN\s-]+$/i;

View File

@ -15,6 +15,7 @@ ddg_goodie_test(
'reverse bla' => test_zci('Reversed "bla": alb'),
'reverse blabla' => test_zci('Reversed "blabla": albalb'),
'reverse esrever' => test_zci('Reversed "esrever": reverse'),
'reverse' => undef,
#Should not trigger on a request for DNA/RNA reverse complement
'reverse complement of ATG-CTA-GGG-GCT' => undef,