File: 33parseweb.t

package info (click to toggle)
libparse-debcontrol-perl 2.005-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 384 kB
  • sloc: perl: 910; makefile: 2
file content (37 lines) | stat: -rw-r--r-- 903 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/perl -w

use Test::More tests => 4;
use Compress::Zlib;
use LWP::Simple;

BEGIN {
        chdir 't' if -d 't';
        use lib '../blib/lib', 'lib/', '..';
}


my $mod = "Parse::DebControl";

#Object initialization - 2 tests

	use_ok($mod);
	ok($pdc = new Parse::DebControl(), "Parser object creation works fine");

#parse_web - 2 tests
#Even though testing with the web can be uncertain, we can be sure of two things
# - Debian is around
# - Debian has more than 1k packages


        SKIP: {
		skip "Skipping time-consuming web tests", 2 unless($ENV{alltests});

		my $url = "http://ftp.debian.org/dists/sid/main/binary-i386/Packages.gz";
		my $content = get($url);

                skip "Web test at debian not available", 2 unless($content);

		ok(my $data = $pdc->parse_web($url, {"tryGzip" => 1}), "parse_web is sane");
		ok(int(@$data) > 1000, "...data looks sane enough");
        }