some bug #896 related tests

This commit is contained in:
pierre 2000-03-27 09:47:32 +00:00
parent 9c44048ad2
commit 7a5fcf6931
3 changed files with 66 additions and 0 deletions

16
tests/webtbf/tbug896.pp Normal file
View File

@ -0,0 +1,16 @@
var
dat : file;
j : longint;
Buffer : Array[0..2047] of byte;
begin
for j:=0 to 2047 do
Buffer[j]:=j and $ff;
Assign(dat,'tbug896.txt');
Rewrite(dat,1);
for j:= 0 to 2047 do
{ write should not be allowed for untyped files }
write (dat,Buffer[j]);
Close(dat);
end.

16
tests/webtbf/tbug896a.pp Normal file
View File

@ -0,0 +1,16 @@
var
dat : file of byte;
j : longint;
Buffer : Array[0..2047] of byte;
begin
for j:=0 to 2047 do
Buffer[j]:=j and $ff;
Assign(dat,'tbug896.txt');
Rewrite(dat,1);
for j:= 0 to 2047 do
{ writeln should not be allowed for typed files }
writeln (dat,Buffer[j]);
Close(dat);
end.

34
tests/webtbs/tbug896.pp Normal file
View File

@ -0,0 +1,34 @@
var
dat,dat2 : file of byte;
j : longint;
Buffer,Buffer2 : Array[0..2047] of byte;
begin
for j:=0 to 2047 do
Buffer[j]:=j and $ff;
Assign(dat,'tbug896.txt');
Rewrite(dat,1);
for j:= 0 to 2047 do
write (dat,Buffer[j]);
Close(dat);
Assign(dat2,'tbug896a.txt');
Rewrite(dat2);
for j:= 0 to 2047 do
write (dat2,Buffer[j]);
Close(dat2);
Reset(dat);
Reset(dat2,1);
for j:=0 to 2047 do
begin
read(dat,Buffer[j]);
read(dat2,Buffer2[j]);
if Buffer[j]<>Buffer2[j] then
begin
Writeln('Error in typed file handling');
Halt(1);
end;
end;
Close(dat);
close(dat2);
end.