Explorar o código

+ test for mantis #12202

git-svn-id: trunk@11824 -
Jonas Maebe %!s(int64=17) %!d(string=hai) anos
pai
achega
edb86ee95f
Modificáronse 2 ficheiros con 35 adicións e 0 borrados
  1. 1 0
      .gitattributes
  2. 34 0
      tests/webtbs/tw12202.pp

+ 1 - 0
.gitattributes

@@ -8558,6 +8558,7 @@ tests/webtbs/tw12050b.pp svneol=native#text/plain
 tests/webtbs/tw12051.pp svneol=native#text/plain
 tests/webtbs/tw12051.pp svneol=native#text/plain
 tests/webtbs/tw1207.pp svneol=native#text/plain
 tests/webtbs/tw1207.pp svneol=native#text/plain
 tests/webtbs/tw12186.pp svneol=native#text/plain
 tests/webtbs/tw12186.pp svneol=native#text/plain
+tests/webtbs/tw12202.pp svneol=native#text/plain
 tests/webtbs/tw12214.pp svneol=native#text/plain
 tests/webtbs/tw12214.pp svneol=native#text/plain
 tests/webtbs/tw1222.pp svneol=native#text/plain
 tests/webtbs/tw1222.pp svneol=native#text/plain
 tests/webtbs/tw1223.pp svneol=native#text/plain
 tests/webtbs/tw1223.pp svneol=native#text/plain

+ 34 - 0
tests/webtbs/tw12202.pp

@@ -0,0 +1,34 @@
+program try;
+
+procedure check(s: string);
+var
+  i: longint;
+begin
+  delete(s,pos(' ',s),1);
+  delete(s,pos('E',s),1);
+  delete(s,pos('.',s),1);
+  delete(s,pos('+',s),1);
+  for i := 1 to length(s) do
+    if (s[i]<>'0') then
+      halt(1);
+end;
+
+var
+  foo: single;
+  d: double;
+  e: extended;
+  s: string;
+begin
+   foo:=0.0;
+   d:=0.0;
+   e:=0.0;
+   str(foo,s);
+   writeln(s);
+   check(s);
+   str(d,s);
+   writeln(s);
+   check(s);
+   str(e,s);
+   writeln(s);
+   check(s);
+end.