Fixed wrong triggering for base conversion IA (#4010)
parent
d7b0bfe9a3
commit
6741796f7c
|
@ -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;
|
||||
|
|
3
t/Base.t
3
t/Base.t
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue