Remove pornhub.lua
[quvi.git] / tests / t / format_other.t
blobf7b3edc0513ea27107d226a3d1f555607470f501
2 use warnings;
3 use strict;
5 use Test::More;
7 eval "use JSON::XS";
8 plan skip_all => "JSON::XS required for testing" if $@;
10 eval "use Test::Deep";
11 plan skip_all => "Test::Deep required for testing" if $@;
13 use Test::Quvi;
15 my $q = Test::Quvi->new;
17 my @files = $q->find_json(
18   qw(
19     data/format/other
20     data/format/default/ignore/length_bytes
21     )
24 plan skip_all => "Nothing to test" if scalar @files == 0;
25 plan tests => scalar @files * 2;
27 my $j   = $q->get_json_obj;
28 my $ign = qr|/ignore/(.*?)/|;
30 foreach (@files)
32   my $e = $q->read_json($_);
34   $q->mark_ignored(\$e, $1) if $_ =~ /$ign/;
36   my $f = $e->{format_requested};
37   my ($r, $o) = $q->run($e->{page_url}, "-qrf $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   }
48 # vim: set ts=2 sw=2 tw=72 expandtab: