~ubuntu-branches/ubuntu/saucy/libquvi/saucy-proposed

« back to all changes in this revision

Viewing changes to tests/t/format_other.t

  • Committer: Bazaar Package Importer
  • Author(s): Alejandro Garrido Mota
  • Date: 2011-04-25 01:07:41 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110425010741-nalzd12y180qs082
Tags: 0.2.15-1
* New upstream release (Closes: #622253). 
* Update d/watch to sf.net
* Update homepage field to quvi.sourceforge.net (Closes: #615554) 
* d/rules: Add dh_auto_test before NO_INTERNET=1 in override_dh_auto_test 
* Update Standards-Version field to 3.9.2 
* Add symbol (d/libquvi0.symbols) file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
use warnings;
 
3
use strict;
 
4
 
 
5
use Test::More;
 
6
 
 
7
eval "use JSON::XS";
 
8
plan skip_all => "JSON::XS required for testing" if $@;
 
9
 
 
10
eval "use Test::Deep";
 
11
plan skip_all => "Test::Deep required for testing" if $@;
 
12
 
 
13
use Test::Quvi;
 
14
 
 
15
my $q = Test::Quvi->new;
 
16
 
 
17
my @files = $q->find_json(
 
18
    qw(
 
19
      data/format/other
 
20
      data/format/default/ignore/length_bytes
 
21
      )
 
22
);
 
23
 
 
24
plan skip_all => "Nothing to test" if scalar @files == 0;
 
25
plan tests => scalar @files * 2;
 
26
 
 
27
my $j   = $q->get_json_obj;
 
28
my $ign = qr|/ignore/(.*?)/|;
 
29
 
 
30
foreach (@files)
 
31
{
 
32
    my $e = $q->read_json($_);
 
33
 
 
34
    $q->mark_ignored(\$e, $1) if $_ =~ /$ign/;
 
35
 
 
36
    my $f = $e->{format_requested};
 
37
    my ($r, $o) = $q->run($e->{page_url}, "-qsf $f");
 
38
    is($r, 0, "quvi exit status == 0")
 
39
      or diag $e->{page_url};
 
40
  SKIP:
 
41
    {
 
42
        skip 'quvi exit status != 0', 1 if $r != 0;
 
43
        cmp_deeply($j->decode($o), $e, "compare with $_")
 
44
          or diag $e->{page_url};
 
45
    }
 
46
}