ソースを参照

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

git-svn-id: trunk@12325 -
michael 17 年 前
コミット
e357cd02ac
1 ファイル変更17 行追加1 行削除
  1. 17 1
      tests/webtbs/tw12385.pp

+ 17 - 1
tests/webtbs/tw12385.pp

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