X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=t%2Fvalidate_card.t;fp=t%2Fvalidate_card.t;h=76fcca0fb2127dd24c388c851276cd518f16e7ea;hb=829e413cb27bb1ad40edc206bfd3a25bbeae70ca;hp=0000000000000000000000000000000000000000;hpb=9d3431a09a659667e24c16472d257d0ebaff513d;p=Business-CreditCard.git diff --git a/t/validate_card.t b/t/validate_card.t new file mode 100644 index 0000000..76fcca0 --- /dev/null +++ b/t/validate_card.t @@ -0,0 +1,25 @@ +#mostly just a quick test of validate_card() as the new name for validate() +# and the :NEW import tag to bring it in + +my @test_table=( + '4111 1111 1111 1111', + '5454 5454 5454 5454', +); + +my @bad_table=( + '4111 1111 1111 1112', + '5454 5454 5454 5455', +); + +use Test::More tests => 4; #haha no scalar(@test_table) + scalar(@bad_table); +use Business::CreditCard qw( :NEW ); + +foreach my $card (@test_table) { + ok( validate_card($card), "validate_card($card)" ); +} + +foreach my $card (@bad_table) { + ok( ! validate_card($card), "! validate_card($card)" ); +} + +1;