{: test that accessing a file after eof causes a fatal error }

{$d+}
program d04c( output );

var
   f    : text;
   c    : char;

begin {d04c}

   rewrite(f);
   writeln(f, 'xyz');
   reset(f);
   readln(f,c); {should now be at eof}

   if eoln(f) then {!!! invalid file access}
      writeln('this should not be printed');

   writeln( 'fails: eoln when at eof error not detected' );
end. { d04c }

