2014-07-24 12:55:49 -07:00
|
|
|
#!/usr/bin/env perl
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
use Test::More;
|
|
|
|
use DDG::Test::Goodie;
|
|
|
|
|
|
|
|
zci answer_type => 'rand';
|
|
|
|
zci is_cached => 0;
|
|
|
|
|
|
|
|
ddg_goodie_test(
|
2014-10-15 07:44:27 -07:00
|
|
|
[qw( DDG::Goodie::RandomNumber )],
|
|
|
|
'random number between 12 and 45' => test_zci(
|
|
|
|
qr/\d{2} \(random number\)/,
|
|
|
|
structured_answer => {
|
|
|
|
input => [12, 45],
|
2015-01-09 00:46:54 -08:00
|
|
|
operation => 'Random number between',
|
2014-10-15 07:44:27 -07:00
|
|
|
result => qr/^\d{2}$/
|
|
|
|
}
|
|
|
|
),
|
|
|
|
'random number' => test_zci(qr/\d{1}\.\d+ \(random number\)/,
|
|
|
|
structured_answer => {
|
|
|
|
input => [0, 1],
|
2015-01-09 00:46:54 -08:00
|
|
|
operation => 'Random number between',
|
2014-10-15 07:44:27 -07:00
|
|
|
result => qr/\d{1}\.\d+/,
|
|
|
|
}
|
|
|
|
),
|
|
|
|
'random day' => undef,
|
|
|
|
'random access' => undef,
|
2014-07-24 12:55:49 -07:00
|
|
|
);
|
|
|
|
done_testing
|