Browse Source

+ new bugs

pierre 25 years ago
parent
commit
0c99cac9ce
4 changed files with 78 additions and 0 deletions
  1. 9 0
      tests/webtbs/tbug769.pp
  2. 28 0
      tests/webtbs/tbug772.pp
  3. 16 0
      tests/webtbs/tbug776.pp
  4. 25 0
      tests/webtbs/tbug784.pp

+ 9 - 0
tests/webtbs/tbug769.pp

@@ -0,0 +1,9 @@
+
+Program test;
+
+var x,y:integer;
+
+begin
+y:=5;
+for x:=0 to 10 do if x<y then writeln(x);
+end.

+ 28 - 0
tests/webtbs/tbug772.pp

@@ -0,0 +1,28 @@
+type tFoo = object
+       a:integer;
+       constructor Create;
+       procedure ReadA;
+       procedure ShowA;
+     end;
+
+constructor tFoo.Create;
+begin
+  a:=0;
+end;
+
+procedure tFoo.ReadA;
+begin
+  write('a: '); Readln(a);
+end;
+
+procedure tFoo.ShowA;
+begin
+  writeln('A=',a);
+end;
+
+var Foo:tFoo;
+begin
+  Foo.Create;
+  Foo.ReadA; {this leaves Foo.a untouched, but it should'nt}
+  Foo.ShowA;
+end.

+ 16 - 0
tests/webtbs/tbug776.pp

@@ -0,0 +1,16 @@
+{$mode objfpc}
+uses sysutils;
+ var i:integer;
+     j : record
+        x,y : longint;
+     end;
+begin
+ i:=0;
+ format('%d', [i]);
+ with j do
+   begin
+     x:=2;
+     y:=4;
+     Writeln('j.x=',x,' j.y=',y);
+   end;
+end.

+ 25 - 0
tests/webtbs/tbug784.pp

@@ -0,0 +1,25 @@
+program BigRange;
+
+const
+  Limit   = 100000000; { Hundred millions }
+  One     =         1;
+
+var
+  Huge: longint;
+
+begin
+    Huge := Limit + One;
+
+    writeln(One, ' is the lower bound');
+    writeln(Limit, ' is the upper bound');
+
+    if Limit in [One .. Limit] then
+      writeln(Limit, ' is within the range')
+    else
+      writeln(Limit, ' is out of the range');
+
+    if Huge in [One .. Limit] then
+      writeln(Huge, ' is within the range')
+    else
+      writeln(Huge, ' is out of the range')
+end.