zeroclickinfo-goodies/t/ChordDiagrams.t

95 lines
1.9 KiB
Perl
Raw Permalink Normal View History

2016-03-28 18:04:53 -07:00
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
2016-06-09 13:32:55 -07:00
use Test::Deep;
2016-03-28 18:04:53 -07:00
use DDG::Test::Goodie;
zci answer_type => 'chord_diagrams';
zci is_cached => 1;
ddg_goodie_test(
2016-03-29 17:17:20 -07:00
[ 'DDG::Goodie::ChordDiagrams' ],
'Amaj9 guitar chord' => test_zci(
'chord_diagrams',
structured_answer => {
id => 'chord_diagrams',
name => 'Music',
2016-06-09 13:32:55 -07:00
data => re(qr/.*/),
2016-03-29 17:17:20 -07:00
templates => {
2016-06-09 13:32:55 -07:00
group => "base",
detail => 0,
options => {
content => 'DDH.chord_diagrams.detail'
},
variants => {
tile => 'narrow'
}
2016-03-29 17:17:20 -07:00
},
}),
'Cm ukulele chord' => test_zci(
'chord_diagrams',
structured_answer => {
id => 'chord_diagrams',
name => 'Music',
2016-06-09 13:32:55 -07:00
data => re(qr/.*/),
2016-03-29 17:17:20 -07:00
templates => {
2016-06-09 13:32:55 -07:00
group => "base",
detail => 0,
options => {
content => 'DDH.chord_diagrams.detail'
},
variants => {
tile => 'narrow'
}
2016-03-29 17:17:20 -07:00
},
}),
'Eb uke tabs' => test_zci(
'chord_diagrams',
structured_answer => {
id => 'chord_diagrams',
name => 'Music',
data => re(qr/.*/),
templates => {
group => "base",
detail => 0,
options => {
content => 'DDH.chord_diagrams.detail'
},
variants => {
tile => 'narrow'
}
},
}),
'A major guitar tab' => test_zci(
'chord_diagrams',
structured_answer => {
id => 'chord_diagrams',
name => 'Music',
data => re(qr/.*/),
templates => {
group => "base",
detail => 0,
options => {
content => 'DDH.chord_diagrams.detail'
},
variants => {
tile => 'narrow'
}
},
}),
2016-03-29 17:17:20 -07:00
# check that certain things don't trigger it:
'C# programming' => undef,
'C programming' => undef,
'D programming' => undef,
'guitar chord finder' => undef,
'guitar chord fminute' => undef,
'G' => undef,
'A sharp tabs' => undef,
'randomstring guitar chords' => undef
2016-03-29 17:17:20 -07:00
);
2016-03-28 18:04:53 -07:00
2016-03-29 17:17:20 -07:00
done_testing;