[Koha-cvs] CVS: koha/t Input.t,NONE,1.1.2.1

Alan Millar amillar at users.sourceforge.net
Thu Jun 20 17:19:36 CEST 2002


Update of /cvsroot/koha/koha/t
In directory usw-pr-cvs1:/tmp/cvs-serv8186/t

Added Files:
      Tag: rel-1-2
	Input.t 
Log Message:
Test valid ISBN numbers in Input.pm

--- NEW FILE ---
# $Id: Input.t,v 1.1.2.1 2002/06/20 15:19:34 amillar Exp $

#use strict;

BEGIN { $| = 1; print "1..13\n"; }
END {print "not ok 1\n" unless $loaded;}
use C4::Input;
$loaded = 1;
print "ok 1\n";

my $TestCount=1;

#-----------------
# Test ISBN validation

my $isbn;

# Good numbers
foreach $isbn ('0836213092','087784805X','087784805x','1878685899') {
    PrintNextTestResult ( &checkvalidisbn($isbn), "Good ISBN: $isbn" ) 
}

# Bad numbers
foreach $isbn ('0836213192','087784804X','087784806x','1878685898', 
		'', ' ', 'abc', '1234567890123') {
    PrintNextTestResult ( ! &checkvalidisbn($isbn), "Bad ISBN: $isbn" ) 
}



#-----------------------
sub PrintNextTestResult {
    # modifies global var $TestCount
    my ($ThisTestResult, $TestComment )=@_;

    $TestCount++;

    if ( $ThisTestResult ) {
        print "ok $TestCount\n";
    } else {
	print STDERR "\nTest failed: $TestComment\n";
        print "not ok $TestCount\n";
    }

} # sub PrintNextTestResult

#-----------------------
# $Log: Input.t,v $
# Revision 1.1.2.1  2002/06/20 15:19:34  amillar
# Test valid ISBN numbers in Input.pm
#





More information about the Koha-cvs mailing list