From 1f215ecc86d89b23ef3fd9b06abe253804bbb4c3 Mon Sep 17 00:00:00 2001 From: sergei Date: Wed, 6 Oct 2010 17:33:29 +0000 Subject: [PATCH] + Test for System.Delete() with Size argument equal to MaxInt, Mantis #17514 git-svn-id: trunk@16093 - --- .gitattributes | 1 + tests/webtbs/tw17514.pp | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 tests/webtbs/tw17514.pp diff --git a/.gitattributes b/.gitattributes index 9d9443ebd9..e31cbc39e9 100644 --- a/.gitattributes +++ b/.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 diff --git a/tests/webtbs/tw17514.pp b/tests/webtbs/tw17514.pp new file mode 100644 index 0000000000..f122559a42 --- /dev/null +++ b/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. \ No newline at end of file