zeroclickinfo-goodies/t/FrequencySpectrum.t

58 lines
1.2 KiB
Perl
Raw Normal View History

#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
use DDG::Test::Goodie;
zci answer_type => 'frequency_spectrum';
ddg_goodie_test(
['DDG::Goodie::FrequencySpectrum'],
2014-07-05 01:05:03 -07:00
#Primary example
'50 hz' => test_zci(
2014-07-05 01:05:03 -07:00
qr/radio.+SLF.+audible.+double-bass.+piano.+tuba/,
html => qr/radio/
),
2014-07-05 01:05:03 -07:00
#Secondary example
'400 thz' => test_zci(
2014-07-05 01:05:03 -07:00
qr/visible.+red/,
html => qr/visible.+red/
),
2014-07-05 01:05:03 -07:00
#Misc
2014-01-23 11:35:32 -08:00
'1,000 hz' => test_zci(
2014-07-05 01:05:03 -07:00
qr/radio.+audible.+human.+voice.+viola.+violin.+guitar.+mandolin.+banjo.+piano.+saxophone.+flute.+clarinet.+oboe/,
html => qr/radio.+/
2014-01-23 11:35:32 -08:00
),
'1000000.99 hz' => test_zci(
2014-07-05 01:05:03 -07:00
qr/radio.+MF/,
html => qr/radio.+MF/
2014-01-23 11:35:32 -08:00
),
#No whitespace between number and unit
'50hz' => test_zci(
qr/radio.+SLF.+audible.+double-bass.+piano.+tuba/,
html => qr/radio/
),
'400terahertz' => test_zci(
qr/visible.+red/,
html => qr/visible.+red/
),
#Commas in number
'1,000,000.99 hz' => test_zci(
qr/radio.+MF/,
html => qr/radio.+MF/
),
2014-07-05 01:05:03 -07:00
#Should not trigger
2014-01-23 11:35:32 -08:00
'1000.000..99 hz' => undef,
2014-07-05 01:05:03 -07:00
'4 thz' => undef,
);
2014-01-22 10:12:02 -08:00
done_testing;