zeroclickinfo-goodies/t/HexToDec.t

27 lines
1.4 KiB
Perl
Raw Normal View History

2014-06-27 17:11:32 -07:00
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
use DDG::Test::Goodie;
2014-06-30 16:29:34 -07:00
zci answer_type => 'conversion';
zci is_cached => 1;
2014-06-27 17:11:32 -07:00
ddg_goodie_test(
[qw( DDG::Goodie::HexToDec )],
2014-06-30 16:29:34 -07:00
'0xd1038d2e07b42569' => test_zci(
'd1038d2e07b42569 base 16 = 15061036807694329193 base 10 = 01504034322700755022551 base 8',
html => "<div class='zci--hextodec text--primary'><div class='hextodec--decimal'><span class='text--secondary'>Decimal:</span> 15061036807694329193</div><div><span class='text--secondary'>Octal: </span> 01504034322700755022551</div></div>"),
2014-06-30 16:29:34 -07:00
'0x44696f21' => test_zci(
'44696f21 base 16 = 1147760417 base 10 = 010432267441 base 8',
html => "<div class='zci--hextodec text--primary'><div class='hextodec--decimal'><span class='text--secondary'>Decimal:</span> 1147760417</div><div><span class='text--secondary'>Octal: </span> 010432267441</div></div>"),
'0xffffffffffffffffffffff' => test_zci('ffffffffffffffffffffff base 16 = 309485009821345068724781055 base 10 = 0177777777777777777777777777777 base 8',
html => "<div class='zci--hextodec text--primary'><div class='hextodec--decimal'><span class='text--secondary'>Decimal:</span> 309485009821345068724781055</div><div><span class='text--secondary'>Octal: </span> 0177777777777777777777777777777</div></div>"),
2014-06-27 17:11:32 -07:00
'0x44696f2Z' => undef,
'ascii 0x74657374' => undef,
2014-06-27 17:11:32 -07:00
);
done_testing;