zeroclickinfo-goodies/t/Pi.t

58 lines
1.2 KiB
Perl
Raw Normal View History

2014-12-16 12:20:29 -08:00
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
use DDG::Test::Goodie;
2015-06-21 07:02:48 -07:00
use utf8;
2014-12-16 12:20:29 -08:00
zci answer_type => "pi";
zci is_cached => 1;
ddg_goodie_test(
[qw( DDG::Goodie::Pi )],
2015-02-10 14:23:29 -08:00
2015-02-12 00:31:43 -08:00
'pi 23' => test_zci("3.14159265358979323846264",
2015-02-11 06:39:52 -08:00
structured_answer => {
2015-02-21 15:18:56 -08:00
input => [],
operation => ["First 23 digits of Pi"],
2015-02-11 06:39:52 -08:00
result => "3.14159265358979323846264"
}),
2015-03-07 10:41:33 -08:00
'π 8' => test_zci("3.14159265",
2015-02-12 00:31:43 -08:00
structured_answer => {
2015-02-21 15:18:56 -08:00
input => [],
operation => ["First 8 digits of Pi"],
2015-02-12 00:31:43 -08:00
result => "3.14159265"
}),
'12 digits of pi' => test_zci("3.141592653589",
structured_answer => {
2015-02-21 15:18:56 -08:00
input => [],
operation => ["First 12 digits of Pi"],
2015-02-12 00:31:43 -08:00
result => "3.141592653589"
}),
2015-06-21 07:02:48 -07:00
'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"
}),
2015-02-11 06:39:52 -08:00
2015-03-20 07:18:12 -07:00
'pi ff' => undef,
'pi 3f2' => undef
2015-03-19 07:16:51 -07:00
2014-12-16 12:20:29 -08:00
);
done_testing;