Ver Fonte

* check for proper exception type

florian há 3 anos atrás
pai
commit
8f269d4540
1 ficheiros alterados com 10 adições e 0 exclusões
  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;