File: test.pl

package info (click to toggle)
libwww-search-perl 2.50.80-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,636 kB
  • sloc: perl: 9,723; sh: 132; makefile: 16
file content (21 lines) | stat: -rw-r--r-- 443 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
use Test;
$|++;
BEGIN { plan tests => 2 };

use WWW::Search::Googlism;
ok(1);

print "Are you connected to internet [Y/n]?";
chomp($ans = <STDIN>);
if($ans =~ /n/i){
    ok(1);
}
else{
    $query = "googlism";
    $search = new WWW::Search('Googlism');
    $search->native_query(WWW::Search::escape_query($query), { type => 'who' });
    while (my $result = $search->next_result()) {
	$text .= "$result\n";
    }
    ok(($text ? 1 : 0), 1);
}