且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

单元测试期间Ada中的异常处理

更新时间:2023-02-14 17:36:27

您可以在循环内添加一个块。
使用伪语法,它看起来像:

You can add a block inside the loop. Using your pseudo-syntax, it will look something like:

procedure Test_Function is
begin
  from -20 to 20
    begin
      Result := SQRT(i);

      if Result = (Expected) then
         print "Passed";
      end_if;

    exception:
      print "FAILED";
    end;
  end loop;
end Test_Function