Debian Codegraph @

firstgov/test.pl

raw ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 # Before `make install' is performed this script should be runnable with
2 # `make test'. After `make install' it should work as `perl test.pl'
3
4 use ExtUtils::testlib;
5 use WWW::Search::Test qw( new_engine run_gui_test run_test skip_test );
6
7 ######################### We start with some black magic to print on failure.
8
9 # Change 1..1 below to 1..last_test_to_print .
10 # (It may become useful if the test is moved to ./t subdirectory.)
11
12 BEGIN { $| = 1; print "1..5\n"; }
13 END {print "not ok 1\n" unless $loaded;}
14 use WWW::Search::FirstGov;
15 $loaded = 1;
16 print "ok 1\n";
17
18 ######################### End of black magic.
19
20 # Insert your test code below (better if it prints "ok 13"
21 # (correspondingly "not ok 13") depending on the success of chunk 13
22 # of the test code):
23
24 $WWW::Search::Test::iTest = 1; # let Test know that we've already done one test
25
26 &new_engine('FirstGov');
27
28 my $debug = 0;
29
30 # This test returns no results (but we should not get an HTTP error):
31 &run_test($WWW::Search::Test::bogus_query, 0, 0, $debug);
32
33 # This query returns 1 page of results:
34 &run_test('ev' . 'il ja' . 'va jo' . 'ke ap' . 'ple no' . 'se odd' . 'ball', 1, 99, $debug);
35
36 MULTI_TEST:
37 # &skip_test; goto GUI_TEST;
38 # This query returns MANY pages of results:
39 &run_test('commerce', 101, undef, $debug);
40