Ver código fonte

* Added test for bug #12385

git-svn-id: trunk@12092 -
michael 16 anos atrás
pai
commit
1718b7ab6d
2 arquivos alterados com 26 adições e 0 exclusões
  1. 1 0
      .gitattributes
  2. 25 0
      tests/webtbs/tw12385.pp

+ 1 - 0
.gitattributes

@@ -8614,6 +8614,7 @@ tests/webtbs/tw12242.pp svneol=native#text/plain
 tests/webtbs/tw12249.pp svneol=native#text/plain
 tests/webtbs/tw1228.pp svneol=native#text/plain
 tests/webtbs/tw1229.pp svneol=native#text/plain
+tests/webtbs/tw12385.pp svneol=native#text/plain
 tests/webtbs/tw12404.pp svneol=native#text/plain
 tests/webtbs/tw1250.pp svneol=native#text/plain
 tests/webtbs/tw12508a.pp svneol=native#text/plain

+ 25 - 0
tests/webtbs/tw12385.pp

@@ -0,0 +1,25 @@
+{$mode objfpc}
+program tw12385;
+
+uses
+  SysUtils;
+
+var
+  s: string; 
+  cr: Extended; 
+
+begin
+  cr := -1234.567;
+  s:=FormatFloat('0.00', cr);
+  if s<>'-1234.57' then 
+    begin
+    Writeln(S,'<> -1234.57 (latter is correct)');
+    Halt(1);
+    end;
+  S:=FormatFloat('000.000',-1); //returns 0-1.000
+  if s<>'-001.000' then
+     begin
+     Writeln(S,'<> -001.000 (latter is correct)');
+     Halt(1);
+     end;
+end.