trigger Pi goodie with π
parent
8eebd466f9
commit
6489db73c1
|
@ -2,6 +2,7 @@ package DDG::Goodie::Pi;
|
|||
# ABSTRACT: This Goodie returns 'pi' to a user-specified number of decimal places
|
||||
|
||||
use DDG::Goodie;
|
||||
use utf8;
|
||||
|
||||
zci answer_type => "pi";
|
||||
zci is_cached => 1;
|
||||
|
|
19
t/Pi.t
19
t/Pi.t
|
@ -4,6 +4,7 @@ use strict;
|
|||
use warnings;
|
||||
use Test::More;
|
||||
use DDG::Test::Goodie;
|
||||
use utf8;
|
||||
|
||||
zci answer_type => "pi";
|
||||
zci is_cached => 1;
|
||||
|
@ -29,6 +30,24 @@ ddg_goodie_test(
|
|||
operation => ["First 12 digits of Pi"],
|
||||
result => "3.141592653589"
|
||||
}),
|
||||
'12 digits of π' => test_zci("3.141592653589",
|
||||
structured_answer => {
|
||||
input => [],
|
||||
operation => ["First 12 digits of Pi"],
|
||||
result => "3.141592653589"
|
||||
}),
|
||||
'pi to 6 digits' => test_zci("3.141592",
|
||||
structured_answer => {
|
||||
input => [],
|
||||
operation => ["First 6 digits of Pi"],
|
||||
result => "3.141592"
|
||||
}),
|
||||
'π to 6 digits' => test_zci("3.141592",
|
||||
structured_answer => {
|
||||
input => [],
|
||||
operation => ["First 6 digits of Pi"],
|
||||
result => "3.141592"
|
||||
}),
|
||||
|
||||
'pi ff' => undef,
|
||||
'pi 3f2' => undef
|
||||
|
|
Loading…
Reference in New Issue