2013-05-15 08:15:50 -07:00
|
|
|
|
#!/usr/bin/env perl
|
|
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
|
use warnings;
|
2014-03-30 10:40:57 -07:00
|
|
|
|
use utf8;
|
|
|
|
|
|
2013-05-15 08:15:50 -07:00
|
|
|
|
use Test::More;
|
|
|
|
|
use DDG::Test::Goodie;
|
|
|
|
|
|
|
|
|
|
zci answer_type => "prime_factors";
|
|
|
|
|
zci is_cached => 1;
|
|
|
|
|
|
|
|
|
|
ddg_goodie_test(
|
|
|
|
|
[qw(
|
|
|
|
|
DDG::Goodie::PrimeFactors
|
|
|
|
|
)],
|
2014-10-28 11:36:15 -07:00
|
|
|
|
'72 prime factors' => test_zci('The prime factorization of 72 is 2^3 × 3^2',
|
2014-03-30 10:40:57 -07:00
|
|
|
|
html => 'The prime factorization of 72 is 2<sup>3</sup> × 3<sup>2</sup>'),
|
2014-10-28 11:36:15 -07:00
|
|
|
|
'prime factors of 111' => test_zci('The prime factorization of 111 is 3 × 37',
|
2014-03-30 10:40:57 -07:00
|
|
|
|
html => 'The prime factorization of 111 is 3 × 37'),
|
2014-10-28 11:36:15 -07:00
|
|
|
|
'prime factors of 30' => test_zci('The prime factorization of 30 is 2 × 3 × 5',
|
2014-03-30 10:40:57 -07:00
|
|
|
|
html => 'The prime factorization of 30 is 2 × 3 × 5'),
|
|
|
|
|
'prime factorization of 45' => test_zci('The prime factorization of 45 is 3^2 × 5',
|
|
|
|
|
html => 'The prime factorization of 45 is 3<sup>2</sup> × 5'),
|
2014-04-19 18:44:21 -07:00
|
|
|
|
'factorize 128' => test_zci('The prime factorization of 128 is 2^7',
|
|
|
|
|
html => 'The prime factorization of 128 is 2<sup>7</sup>'),
|
|
|
|
|
'42 prime factorize' => test_zci('The prime factorization of 42 is 2 × 3 × 7',
|
|
|
|
|
html => 'The prime factorization of 42 is 2 × 3 × 7'),
|
2014-03-26 20:28:17 -07:00
|
|
|
|
'optimus prime 45' => undef,
|
2014-03-25 21:14:40 -07:00
|
|
|
|
);
|
2013-05-15 08:15:50 -07:00
|
|
|
|
|
|
|
|
|
done_testing;
|