warning the user about the redirect after the install has completed,
[koha.git] / t / Input.t
1 # $Id$
2
3 #use strict;
4
5 BEGIN { $| = 1; print "1..13\n"; }
6 END {print "not ok 1\n" unless $loaded;}
7 use C4::Input;
8 $loaded = 1;
9 print "ok 1\n";
10
11 my $TestCount=1;
12
13 #-----------------
14 # Test ISBN validation
15
16 my $isbn;
17
18 # Good numbers
19 foreach $isbn ('0836213092','087784805X','087784805x','1878685899') {
20     PrintNextTestResult ( &checkvalidisbn($isbn), "Good ISBN: $isbn" ) 
21 }
22
23 # Bad numbers
24 foreach $isbn ('0836213192','087784804X','087784806x','1878685898', 
25                 '', ' ', 'abc', '1234567890123') {
26     PrintNextTestResult ( ! &checkvalidisbn($isbn), "Bad ISBN: $isbn" ) 
27 }
28
29
30
31 #-----------------------
32 sub PrintNextTestResult {
33     # modifies global var $TestCount
34     my ($ThisTestResult, $TestComment )=@_;
35
36     $TestCount++;
37
38     if ( $ThisTestResult ) {
39         print "ok $TestCount\n";
40     } else {
41         print STDERR "\nTest failed: $TestComment\n";
42         print "not ok $TestCount\n";
43     }
44
45 } # sub PrintNextTestResult
46
47 #-----------------------
48 # $Log$
49 # Revision 1.2  2002/06/20 18:18:06  tonnesen
50 # 47 files to go, 47 files to go, take one down, pass it around...
51 # 46 files to go.
52 #
53 # Revision 1.1.2.1  2002/06/20 15:19:34  amillar
54 # Test valid ISBN numbers in Input.pm
55 #