2013-03-11 12:48:29 -07:00
#!/usr/bin/env perl
use strict ;
use warnings ;
use Test::More ;
use DDG::Test::Goodie ;
zci answer_type = > 'calc' ;
zci is_cached = > 1 ;
ddg_goodie_test (
[ qw( DDG::Goodie::Calculator ) ] ,
2013-06-28 14:45:24 -07:00
'what is 2-2' = > test_zci (
"2 - 2 = 0" ,
2013-05-04 13:10:30 -07:00
heading = > 'Calculator' ,
2013-06-28 14:45:24 -07:00
html = > qq( <div>2 - 2 = <a href="javascript:;" onClick="document.x.q.value='0';document.x.q.focus ( ) ;">0</a></div> )
2013-05-04 13:10:30 -07:00
) ,
2013-06-28 15:56:27 -07:00
'solve 2+2' = > test_zci (
2013-03-11 12:48:29 -07:00
"2 + 2 = 4" ,
heading = > 'Calculator' ,
html = > qq( <div>2 + 2 = <a href="javascript:;" onClick="document.x.q.value='4';document.x.q.focus ( ) ;">4</a></div> )
) ,
'2^8' = > test_zci (
"2 ^ 8 = 256" ,
heading = > 'Calculator' ,
html = > qq( <div>2<sup>8</sup> = <a href="javascript:;" onClick="document.x.q.value='256';document.x.q.focus ( ) ;">256</a></div> )
) ,
'2 *7' = > test_zci (
"2 * 7 = 14" ,
heading = > 'Calculator' ,
html = > qq( <div>2 * 7 = <a href="javascript:;" onClick="document.x.q.value='14';document.x.q.focus ( ) ;">14</a></div> )
) ,
'1 dozen * 2' = > test_zci (
"1 dozen * 2 = 24" ,
heading = > 'Calculator' ,
html = > qq( <div>1 dozen * 2 = <a href="javascript:;" onClick="document.x.q.value='24';document.x.q.focus ( ) ;">24</a></div> )
) ,
2013-06-08 12:51:33 -07:00
'dozen + dozen' = > test_zci (
"dozen + dozen = 24" ,
heading = > 'Calculator' ,
html = > qq( <div>dozen + dozen = <a href="javascript:;" onClick="document.x.q.value='24';document.x.q.focus ( ) ;">24</a></div> )
) ,
2013-03-11 12:48:29 -07:00
'2divided by 4' = > test_zci (
"2 divided by 4 = 0.5" ,
heading = > 'Calculator' ,
html = > qq( <div>2 divided by 4 = <a href="javascript:;" onClick="document.x.q.value='0.5';document.x.q.focus ( ) ;">0.5</a></div> )
) ,
'(2c) + pi' = > test_zci (
2013-12-25 17:05:37 -08:00
"(2 speed of light) + pi = 599,584,919.141593" ,
2013-03-11 12:48:29 -07:00
heading = > 'Calculator' ,
2013-12-25 17:05:37 -08:00
html = > qq( <div> ( 2 speed of light ) + pi = <a href="javascript:;" onClick="document.x.q.value='599,584,919.141593';document.x.q.focus ( ) ;">599,584,919.141593</a></div> )
2013-03-11 12:48:29 -07:00
) ,
'2^dozen' = > test_zci (
"2 ^ dozen = 4,096" ,
heading = > 'Calculator' ,
html = > qq( <div>2<sup>dozen</sup> = <a href="javascript:;" onClick="document.x.q.value='4,096';document.x.q.focus ( ) ;">4,096</a></div> )
) ,
2013-05-12 17:22:54 -07:00
'2^2' = > test_zci (
"2 ^ 2 = 4" ,
heading = > 'Calculator' ,
html = > qq( <div>2<sup>2</sup> = <a href="javascript:;" onClick="document.x.q.value='4';document.x.q.focus ( ) ;">4</a></div> )
) ,
'2^0.2' = > test_zci (
2013-12-25 17:05:37 -08:00
"2 ^ 0.2 = 1.14869835499704" ,
2013-05-12 17:22:54 -07:00
heading = > 'Calculator' ,
2013-12-25 17:05:37 -08:00
html = > qq( <div>2<sup>0.2</sup> = <a href="javascript:;" onClick="document.x.q.value='1.14869835499704';document.x.q.focus ( ) ;">1.14869835499704</a></div> )
2013-05-12 17:22:54 -07:00
) ,
2013-05-15 16:09:25 -07:00
'cos(0)' = > test_zci (
"cos(0) = 1" ,
heading = > 'Calculator' ,
html = > qq( <div>cos ( 0 ) = <a href="javascript:;" onClick="document.x.q.value='1';document.x.q.focus ( ) ;">1</a></div> )
) ,
'tan(1)' = > test_zci (
2013-12-25 17:05:37 -08:00
"tan(1) = 1.5574077246549" ,
2013-05-15 16:09:25 -07:00
heading = > 'Calculator' ,
2013-12-25 17:05:37 -08:00
html = > qq( <div>tan ( 1 ) = <a href="javascript:;" onClick="document.x.q.value='1.5574077246549';document.x.q.focus ( ) ;">1.5574077246549</a></div> )
2013-05-15 16:09:25 -07:00
) ,
'sin(1)' = > test_zci (
2013-12-25 17:05:37 -08:00
"sin(1) = 0.841470984807897" ,
2013-05-15 16:09:25 -07:00
heading = > 'Calculator' ,
2013-12-25 17:05:37 -08:00
html = > qq( <div>sin ( 1 ) = <a href="javascript:;" onClick="document.x.q.value='0.841470984807897';document.x.q.focus ( ) ;">0.841470984807897</a></div> )
2013-06-08 12:35:24 -07:00
) ,
2014-02-10 13:24:52 -08:00
'$3.43+$34.45' = > test_zci (
'$3.43 + $34.45 = $37.88' ,
heading = > 'Calculator' ,
html = > qq( <div>\$3.43 + \$34.45 = <a href="javascript:;" onClick="document.x.q.value='\$37.88';document.x.q.focus ( ) ;">\$37.88</a></div> )
) ,
'64*343' = > test_zci (
'64 * 343 = 21,952' ,
heading = > 'Calculator' ,
html = > qq( <div>64 * 343 = <a href="javascript:;" onClick="document.x.q.value='21,952';document.x.q.focus ( ) ;">21,952</a></div> ) ,
) ,
2013-06-08 12:35:24 -07:00
'//' = > undef ,
dividedbydividedby = > undef ,
2013-03-11 12:48:29 -07:00
) ;
done_testing ;