From 3143ac068eb9d950b2403cc3163de5ade96273f4 Mon Sep 17 00:00:00 2001 From: djfiander Date: Sun, 30 Apr 2006 01:20:47 +0000 Subject: [PATCH] Add a bunch of tests, and stock field checks --- t/02patron_info.t | 24 +++++++++++++++++++++++- t/SIPtest.pm | 21 +++++++++++++++++++-- 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/t/02patron_info.t b/t/02patron_info.t index 39a7994..86c953c 100644 --- a/t/02patron_info.t +++ b/t/02patron_info.t @@ -1,4 +1,4 @@ -# +#!/usr/bin/perl # patron_info: test Patron Information Response use strict; @@ -18,6 +18,28 @@ my @tests = ( $SIPtest::field_specs{(FID_INST_ID)}, $SIPtest::field_specs{(FID_SCREEN_MSG)}, $SIPtest::field_specs{(FID_PRINT_LINE)}, + { field => FID_PATRON_ID, + pat => qr/^djfiander$/, + required => 1, }, + { field => FID_PERSONAL_NAME, + pat => qr/^David J\. Fiander$/, + required => 1, }, + { field => FID_HOLD_ITEMS_LMT, + pat => qr/^\d{4}$/, + required => 0, }, + { field => FID_OVERDUE_ITEMS_LMT, + pat => qr/^\d{4}$/, + required => 0, }, + { field => FID_CHARDED_ITEMS_LMT, + pat => qr/^\d{4}$/, + required => 0, }, + { field => FID_VALID_PATRON, + pat => qr/^Y$/, + # Not required by the spec, but by the test + required => 1, }, + { field => FID_CURRENCY, + pat => qr/^CAD$/, + required => 0, }, ], }, ); diff --git a/t/SIPtest.pm b/t/SIPtest.pm index acd774b..4ef0939 100644 --- a/t/SIPtest.pm +++ b/t/SIPtest.pm @@ -36,10 +36,27 @@ our %field_specs = ( (FID_PRINT_LINE) => { field => FID_PRINT_LINE, pat => $text_field, required => 0, }, - (FID_INST_ID) => { field => 'AO', + (FID_INST_ID) => { field => FID_INST_ID, pat => qr/^UWOLS$/, required => 1, }, - + (FID_HOLD_ITEMS_LMT)=> { field => FID_HOLD_ITEMS_LMT, + pat => qr/^\d{4}$/, + required => 0, }, + (FID_OVERDUE_ITEMS_LMT)=> { field => FID_OVERDUE_ITEMS_LMT, + pat => qr/^\d{4}$/, + required => 0, }, + (FID_CHARDED_ITEMS_LMT)=> { field => FID_CHARDED_ITEMS_LMT, + pat => qr/^\d{4}$/, + required => 0, }, + (FID_VALID_PATRON) => { field => FID_VALID_PATRON, + pat => qr/^[NY]$/, + required => 0, }, + (FID_VALID_PATRON_PWD)=> { field => FID_VALID_PATRON_PWD, + pat => qr/^[NY]$/, + required => 0, }, + (FID_CURRENCY) => { field => FID_CURRENCY, + pat => qr/^CAD$/, + required => 0, }, ); # Login and SC Status are always the first two messages that -- 2.11.0