zeroclickinfo-goodies/t/Paper.t

38 lines
1.1 KiB
Perl
Raw Normal View History

2013-02-09 10:49:22 -08:00
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
use Test::Deep;
2013-02-09 10:49:22 -08:00
use DDG::Test::Goodie;
2013-02-09 13:13:08 -08:00
zci answer_type => 'paper';
2014-10-14 11:39:20 -07:00
zci is_cached => 1;
2013-02-09 10:49:22 -08:00
2016-05-18 05:06:17 -07:00
sub build_test {
my ($text, $input) = @_;
return test_zci($text, structured_answer => {
data => {
title => $text,
subtitle => "Paper size: $input"
},
templates => {
group => 'text'
}
});
}
2013-02-09 10:49:22 -08:00
ddg_goodie_test(
2014-10-14 11:39:20 -07:00
[qw( DDG::Goodie::Paper )],
2016-05-18 05:06:17 -07:00
'a0 paper size' => build_test('841mm x 1189mm (33.11in x 46.81in)', 'A0'),
'c10 paper dimension' => build_test('28mm x 40mm (1.10in x 1.57in)', 'C10'),
'b10 paper dimensions' => build_test('31mm x 44mm (1.22in x 1.73in)', 'B10'),
'letter paper size' => build_test('8.5in x 11in (215.9mm x 279.4mm)', 'letter'),
2016-05-18 05:06:17 -07:00
'legal paper dimensions' => build_test('216mm x 356mm (8.5in x 14in)', 'legal'),
'junior legal paper dimensions' => build_test('203mm x 127mm (8in x 5in)', 'junior legal'),
'ledger paper dimensions' => build_test('432mm x 279mm (17in x 11in)', 'ledger'),
'tabloid paper size' => build_test('279mm x 432mm (11in x 17in)', 'tabloid'),
2013-02-09 10:49:22 -08:00
);
2016-05-16 06:18:04 -07:00
done_testing;