瀏覽代碼

+ Test for System.Delete() with Size argument equal to MaxInt, Mantis #17514

git-svn-id: trunk@16093 -
sergei 15 年之前
父節點
當前提交
1f215ecc86
共有 2 個文件被更改,包括 36 次插入0 次删除
  1. 1 0
      .gitattributes
  2. 35 0
      tests/webtbs/tw17514.pp

+ 1 - 0
.gitattributes

@@ -10689,6 +10689,7 @@ tests/webtbs/tw17402a.pp svneol=native#text/pascal
 tests/webtbs/tw17413.pp svneol=native#text/plain
 tests/webtbs/tw17430.pp svneol=native#text/plain
 tests/webtbs/tw1744.pp svneol=native#text/plain
+tests/webtbs/tw17514.pp svneol=native#text/plain
 tests/webtbs/tw17546.pp svneol=native#text/plain
 tests/webtbs/tw1754c.pp svneol=native#text/plain
 tests/webtbs/tw1755.pp svneol=native#text/plain

+ 35 - 0
tests/webtbs/tw17514.pp

@@ -0,0 +1,35 @@
+{$ifdef fpc}
+{$mode objfpc}{$h+}
+{$endif}
+
+var
+  a: ansistring;
+  s: shortstring;
+{$ifdef fpc}
+  u: unicodestring;
+{$endif}
+  w: widestring;
+  code: Integer;
+
+begin
+  code := 0;
+  a := 'foo bar';
+  delete(a, 4, maxint);
+  if a <> 'foo' then
+    code := code or 1;
+  s := 'foo bar';
+  delete(s, 4, maxint);
+  if s <> 'foo' then
+    code := code or 2;
+  w := 'foo bar';
+  delete(w, 4, maxint);
+  if w <> 'foo' then
+    code := code or 4;
+{$ifdef fpc}
+  u := 'foo bar';
+  delete(u, 4, maxint);
+  if u <> 'foo' then
+    code := code or 8;
+{$endif}
+  Halt(code);
+end.