Browse Source

* Added more testcases for more digits and positive versus negative tests. FPC matches Delphi now

git-svn-id: trunk@12325 -
michael 16 years ago
parent
commit
e357cd02ac
1 changed files with 17 additions and 1 deletions
  1. 17 1
      tests/webtbs/tw12385.pp

+ 17 - 1
tests/webtbs/tw12385.pp

@@ -1,4 +1,6 @@
+{$ifdef fpc}
 {$mode objfpc}
 {$mode objfpc}
+{$endif}
 program tw12385;
 program tw12385;
 
 
 uses
 uses
@@ -9,8 +11,22 @@ var
   cr: Extended; 
   cr: Extended; 
 
 
 begin
 begin
+  cr := 1234.567;
+  s:=FormatFloat('00000000.00', cr);
+  if s<>'00001234.57' then 
+    begin
+    Writeln(S,'<> 00001234.57 (latter is correct)');
+    Halt(1);
+    end;
+  cr := -1234.567;
+  s:=FormatFloat('00000000.00', cr);
+  if s<>'-00001234.57' then 
+    begin
+    Writeln(S,'<> -00001234.57 (latter is correct)');
+    Halt(1);
+    end;
   cr := -1234.567;
   cr := -1234.567;
-  s:=FormatFloat('0.00', cr);
+  s:=FormatFloat('000.00', cr);
   if s<>'-1234.57' then 
   if s<>'-1234.57' then 
     begin
     begin
     Writeln(S,'<> -1234.57 (latter is correct)');
     Writeln(S,'<> -1234.57 (latter is correct)');