CPAN Module Distributions
Listing 4 5. test.pl Generated by h2xs
# Before make install is performed this script should be runnable with
# make test . After make install it should work as perl test.pl
#########################
# change tests => 1 to tests => last_test_to_print ;
use Test;
BEGIN { plan tests => 1 };
use Data::Counter;
ok(1); # If we made it this far, we re ok.
#########################
# Insert your test code below, the Test module is use()ed here so read
# its man page ( perldoc Test ) for help writing this test script.
The default test script includes one test it attempts to load Data::Counter
and automatically succeeds if that didn't cause the script to die. Another use of the
ok() function is to test that a returned value is what it should be. For example,
Data::Counter has a test for the count() subroutine that checks whether count()
returns 3 when it is called with three arguments:
ok(count("one", "two", "three") == 3);
After adding this test case, a make test run looks like the following:
$ make test
PERL_DL_NONLAZY=1 /usr/local/bin/perl Iblib/arch Iblib/lib \
I/usr/local/lib/perl5/5.6.1/i686 linux I/usr/local/lib/perl5/5.6.1 test.pl
1..2
ok 1
ok 2
If count() were broken, the output would look like this:
1..2
ok 1
not ok 2
# Failed test 2 in test.pl at line 18
10
109
9
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved