Browse Source

* check for proper exception type

florian 2 years ago
parent
commit
8f269d4540
1 changed files with 10 additions and 0 deletions
  1. 10 0
      tests/webtbs/tw3157.pp

+ 10 - 0
tests/webtbs/tw3157.pp

@@ -28,6 +28,11 @@ begin
   on E:Exception do
     begin
       Writeln('Line "c:=..." raised ' +E.ClassName+ ': ' +E.Message);
+      if E.ClassType<>EInvalidOp then
+        begin
+          writeln('EInvalidOp exception expected');
+          halt(1);
+        end;
       dec(notcaught);
     end;
  end;
@@ -46,6 +51,11 @@ begin
   on E:Exception do
    begin
      Writeln('Line "temp_int:=..." raised ' +E.ClassName+ ': ' +E.Message);
+      if E.ClassType<>EInvalidOp then
+        begin
+          writeln('EInvalidOp exception expected');
+          halt(1);
+        end;
      dec(notcaught);
    end;
  end;