瀏覽代碼

new check added

pierre 22 年之前
父節點
當前提交
6c42489ec3
共有 1 個文件被更改,包括 37 次插入0 次删除
  1. 37 0
      tests/webtbs/tw2432.pp

+ 37 - 0
tests/webtbs/tw2432.pp

@@ -0,0 +1,37 @@
+
+{ Source provided for Free Pascal Bug Report 2432 }
+{ Submitted by "Alfred Gaschler" on  2003-03-21 }
+{ e-mail:  [email protected] }
+
+program test;
+
+uses
+  classes;
+
+const
+  has_errors : boolean = false;
+
+procedure a(p : array of tpoint);
+var
+  n : integer;
+begin
+  for n := low(p) to high(p) do
+    begin
+      write(p[n].x,' ',p[n].y,' ');
+      if p[n].x<>n+1 then
+        begin
+          Writeln('Error');
+          has_errors:=true;
+        end;
+      //the result is 1 1 2 2 5 5 4 4 5 5
+      //should be 1 1 2 2 3 3 4 4 5 5
+    end;
+  writeln;
+end;
+
+begin
+  a([point(1,1),point(2,2),point(3,3),
+     point(4,4),point(5,5)]);
+  if has_errors then
+    Halt(1);
+end.