Fixed wrong triggering for base conversion IA (#4010)

master
adv16 2017-03-13 10:46:20 -04:00 committed by Zaahir Moolla
parent d7b0bfe9a3
commit 6741796f7c
2 changed files with 3 additions and 2 deletions

View File

@ -31,7 +31,7 @@ my $prefix_keys = join '|', keys %prefix_map;
triggers any => 'base', keys %base_map;
handle query_clean => sub {
handle query_lc => sub {
return unless /^(?<prefixKey>$prefix_keys)?(?<inp>[0-9A-Za-z]+)\s*((?:(?:in|as)\s+)?(?:(?<inpBaseKey>$map_keys)|(?:base\s*(?<inpBaseNum>[0-9]+)))\s+)?(?:(?:in|as|to)\s+)?(?:(?<outBaseKey>$map_keys)|(?:base\s*(?<outBaseNum>[0-9]+)))$/;
my $input = uc $+{'inp'}; # uc is necessary as Int2Base doesnt support lowercase
my $from_base = 10;

View File

@ -47,7 +47,8 @@ ddg_goodie_test(
'HELLOWORLD as base 33 to dec'=> build_test('HELLOWORLD', 33, 10, '809608041709942'),
'0xFF in binary to decimal' => undef,
'0b1111 in hex as binary' => undef,
'0xFF in binary hex as decimal' => undef
'0xFF in binary hex as decimal' => undef,
'0.01% in decimal' => undef
);
done_testing;