Program TSTUCDATE;

{File: [22,311]TSTUCDATE.PAS      Last edit: 10-JUN-1987 07:52:56 

 History:  9-Jun-87.  Bob Thomas.   Created.
}

{ Test routine to test UCDATE - The Uncompress date P3UTIL library routine }

%INCLUDE LB:[22,320]GENERAL3.TYP;
%INCLUDE EX:[22,320]SASSIGN.EXT;
%INCLUDE LB:[22,320]UCDATE.EXT;

Var
  A_in_date: CH7;
  Z_in_date: PACKED ARRAY[0..7]OF char;
  L_in_date: CH20;
  A_out_date: DEC_date;
  Z_out_date: PACKED ARRAY[0..9]OF char;
  L_out_date: CH20;
  resp: char;


Begin
writeln;
writeln('Begin test');
writeln;
A_in_date:='18Jul87';
sassign(Z_in_date,A_in_date);
sassign(L_in_date,A_in_date);

{test DEC date strings}
writeln('Testing DEC date strings');
ucdate(A_in_date,A_out_date);
writeln('In_date ',A_in_date,'  Out_date ',A_out_date);

{test type zero strings}
writeln('Testing type zero strings');
ucdate(Z_in_date,Z_out_date);
sassign(A_in_date,Z_in_date);
sassign(A_out_date,Z_out_date);
writeln('In_date ',A_in_date,'  Out_date ',A_out_date);

{test long strings}
writeln('Testing long strings');
ucdate(L_in_date,L_out_date);
writeln('In_date ',L_in_date,'  Out_date ',L_out_date);

{test mixed strings}
writeln('Testing mixed DEC-date/type-zero strings');
sassign(Z_out_date,'         ');
ucdate(A_in_date,Z_out_date);
sassign(A_out_date,Z_out_date);
writeln('In_date ',A_in_date,'  Out_date ',A_out_date);

{test DEC date strings}
writeln('Testing mixed long/DEC-date strings');
sassign(A_out_date,'         ');
ucdate(A_in_date,A_out_date);
writeln('In_date ',A_in_date,'  Out_date ',A_out_date);

{test Long date strings with other information present}
writeln('Testing long strings with other information present ');
sassign(L_in_date,'15Jul87 12:15:00');
sassign(L_out_date,'12345678901234567890');
ucdate(L_in_date,L_out_date);
writeln('In_date ',L_in_date,'  Out_date ',L_out_date);

repeat
  write('Enter Test date > ');
  readln(L_in_date);
  writeln;
  ucdate(L_in_date,A_out_date);
  writeln('In_date ',L_in_date,'  Out_date ',A_out_date);
  writeln;
  write('Loop again (Y,N)> ');
  readln(resp);
  until (resp <> 'Y') and (resp <> 'y');
writeln;
writeln('End test');
writeln;
end.


