zeroclickinfo-goodies/t/Constants.t

58 lines
1.6 KiB
Perl
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Test::More;
use DDG::Test::Goodie;
zci answer_type => "constants";
zci is_cached => 1;
ddg_goodie_test(
[qw( DDG::Goodie::Constants )],
"Hardy Ramanujan number" => test_zci(
'1<sup>3</sup> + 12<sup>3</sup> = 9<sup>3</sup> + 10<sup>3</sup>',
structured_answer => {
input => [],
operation => 'Hardy Ramanujan Number 1729',
result => "1<sup>3</sup> + 12<sup>3</sup> = 9<sup>3</sup> + 10<sup>3</sup>",
meta => {signal => 'high'}
}
),
#without apostrophe
"Avogadros number" => test_zci(
'6.0221415 × 10<sup>23</sup> mol<sup>-1</sup>',
structured_answer => {
input => [],
operation => 'Avogadro\'s Number',
result => '6.0221415 × 10<sup>23</sup> mol<sup>-1</sup>',
meta => {signal => 'high'}
}
),
#with apostrophe
"Avogadro's number" => test_zci(
'6.0221415 × 10<sup>23</sup> mol<sup>-1</sup>',
structured_answer => {
input => [],
operation => 'Avogadro\'s Number',
result => '6.0221415 × 10<sup>23</sup> mol<sup>-1</sup>',
meta => {signal => 'high'}
}
),
#constant without html (only plain)
"Eulers constant" => test_zci(
'0.577215665',
structured_answer => {
input => [],
operation => 'Euler\'s Constant',
result => '0.577215665',
meta => {signal => 'high'}
}
),
"How old is my grandma?" => undef,
"why?" => undef,
);
done_testing;