Browse Source

+ bug256-258

pierre 26 years ago
parent
commit
0e57fc0f34
6 changed files with 101 additions and 1 deletions
  1. 0 1
      tests/tbs0215.pp
  2. 14 0
      tests/tbs0220.pp
  3. 13 0
      tests/tbs0221.pp
  4. 13 0
      tests/tbs0256.pp
  5. 18 0
      tests/tbs0257.pp
  6. 43 0
      tests/tbs0258.pp

+ 0 - 1
tests/tbs0215.pp

@@ -18,7 +18,6 @@ Type
       Procedure VirtualMethod; virtual;
    End;
 
-
 Constructor Y.Init(NewA:LongInt);
    Begin
       A:=NewA;

+ 14 - 0
tests/tbs0220.pp

@@ -0,0 +1,14 @@
+type
+  a = array[0..100] of char;
+
+var
+  a1 : a;
+  s : string;
+begin
+  a1[0]:='1';a1[2]:='2';a1[3]:='3';
+  a1[4]:='4';a1[5]:='5';a1[6]:='6';
+  a1[7]:='7';a1[8]:='8';a1[9]:='9';
+  a1[10]:='0';a1[11]:='1';
+  s:=Copy(a1,1,10);
+  if s<>'1234567890' then halt(1);
+end.

+ 13 - 0
tests/tbs0221.pp

@@ -0,0 +1,13 @@
+
+var
+  r : double;
+  c : char;
+begin
+  r:=1.;
+  c:=^.; { this compile in tp7, c should contain 'n'/#110 }
+  if c<>#110 then
+    begin
+       Writeln('FPC does not support ^. character!');
+       Halt(1);
+    end;
+end.

+ 13 - 0
tests/tbs0256.pp

@@ -0,0 +1,13 @@
+{$mode tp}
+
+{$undef dummy }
+    
+{$ifdef dummy}
+    procedure test;
+      begin
+         foreach({$ifndef TP}@{$endif}add_to_browserlog);
+      end;
+{$endif BrowserLog}
+
+begin
+end.

+ 18 - 0
tests/tbs0257.pp

@@ -0,0 +1,18 @@
+{$mode tp}
+
+type proc = procedure(a : longint);
+procedure test(b : longint);
+begin
+  Writeln('Test ',b);
+end;
+
+var
+  t : proc;
+
+begin
+  t:=test;
+  t:=proc(test);
+  test(3);
+  t(5);
+end.
+

+ 43 - 0
tests/tbs0258.pp

@@ -0,0 +1,43 @@
+program test_set;
+
+var error : boolean;
+
+
+procedure test;
+
+   var
+      i : longint;
+      x : array [1..32] of byte;
+
+   begin
+      error:=false;
+      for i:=1 to 32 do x[i]:=$ff;
+      i:=1;
+      if i in [1,3,5,8,11,14,15] then
+        writeln('1 is in [1,3,5,8,11,14,15]')
+      else
+        writeln('Error in set');
+      i:=135;
+      if i in [1,3,5,8,11,14,15] then
+        begin
+           writeln('Error : 135 is in [1,3,5,8,11,14,15]');
+           error:=true;
+        end;
+      for i:=1 to 32 do x[i]:=0;
+      i:=135;
+      if i in [1,3,5,8,11,14,15] then
+        begin
+           writeln('Second try Error : 135 is in [1,3,5,8,11,14,15]')
+           error:=true;
+        end
+      else
+        begin
+           if error then
+             writeln('Result of 135 in [1,3,5,8,11,14,15] depends on x array !!');
+        end;
+   end;
+
+begin
+   test;
+   if error then halt(1);
+end.