From 42832675d85678ed546a6d945ecb7e268e05aa67 Mon Sep 17 00:00:00 2001 From: paul Date: Sat, 17 Sep 2011 10:40:45 +0000 Subject: [PATCH] merge r13482 from cpstrnew branch by florian: + first tests for code page aware strings git-svn-id: trunk@19081 - --- .gitattributes | 5 +++++ tests/test/tcpstr1.pp | 30 ++++++++++++++++++++++++++++++ tests/test/tcpstr2.pp | 12 ++++++++++++ tests/test/tcpstr2a.pp | 13 +++++++++++++ tests/test/tcpstr3.pp | 11 +++++++++++ tests/test/tcpstr4.pp | 11 +++++++++++ 6 files changed, 82 insertions(+) create mode 100644 tests/test/tcpstr1.pp create mode 100644 tests/test/tcpstr2.pp create mode 100644 tests/test/tcpstr2a.pp create mode 100644 tests/test/tcpstr3.pp create mode 100644 tests/test/tcpstr4.pp diff --git a/.gitattributes b/.gitattributes index 3f5249c9fa..3b569cd405 100644 --- a/.gitattributes +++ b/.gitattributes @@ -9936,6 +9936,11 @@ tests/test/tconstref1.pp svneol=native#text/pascal tests/test/tconstref2.pp svneol=native#text/pascal tests/test/tconstref3.pp svneol=native#text/pascal tests/test/tconstref4.pp svneol=native#text/pascal +tests/test/tcpstr1.pp svneol=native#text/plain +tests/test/tcpstr2.pp svneol=native#text/plain +tests/test/tcpstr2a.pp svneol=native#text/plain +tests/test/tcpstr3.pp svneol=native#text/plain +tests/test/tcpstr4.pp svneol=native#text/plain tests/test/tcstring1.pp svneol=native#text/pascal tests/test/tcstring2.pp svneol=native#text/pascal tests/test/tdel1.pp svneol=native#text/plain diff --git a/tests/test/tcpstr1.pp b/tests/test/tcpstr1.pp new file mode 100644 index 0000000000..6006627587 --- /dev/null +++ b/tests/test/tcpstr1.pp @@ -0,0 +1,30 @@ +type + tcpstr437 = string<437>; + tcpstr850 = string<850>; +var + a1 : tcpstr437; + a2 : utf8string; + a3 : tcpstr850; + u1 : unicodestring; +begin + a1:=#132; + a2:=a1; + if ord(a2[1])<>195 then + halt(1); + if ord(a2[2])<>164 then + halt(1); + + writeln('---'); + + a3:=a1; + if ord(a3[1])<>132 then + halt(1); + + writeln('---'); + + u1:=a1; + if ord(u1[1])<>228 then + halt(1); + + writeln('ok'); +end. diff --git a/tests/test/tcpstr2.pp b/tests/test/tcpstr2.pp new file mode 100644 index 0000000000..fe7a478ea9 --- /dev/null +++ b/tests/test/tcpstr2.pp @@ -0,0 +1,12 @@ +procedure p(const S : RawByteString); overload; + begin + end; + +procedure p(const S : UTF8String); overload; + begin + end; +var + s1 : RawByteString; +begin + p(s1); +end. diff --git a/tests/test/tcpstr2a.pp b/tests/test/tcpstr2a.pp new file mode 100644 index 0000000000..59c962490d --- /dev/null +++ b/tests/test/tcpstr2a.pp @@ -0,0 +1,13 @@ +{ %fail } +procedure p(const S : RawByteString); overload; + begin + end; + +procedure p(const S : UTF8String); overload; + begin + end; +var + s1 : Ansistring; +begin + p(s1); +end. diff --git a/tests/test/tcpstr3.pp b/tests/test/tcpstr3.pp new file mode 100644 index 0000000000..722139bcbd --- /dev/null +++ b/tests/test/tcpstr3.pp @@ -0,0 +1,11 @@ +{ %fail } +procedure p(var S : RawByteString); + begin + end; + +var + s1 : ansistring; + +begin + p(s1); +end. diff --git a/tests/test/tcpstr4.pp b/tests/test/tcpstr4.pp new file mode 100644 index 0000000000..4a73d99469 --- /dev/null +++ b/tests/test/tcpstr4.pp @@ -0,0 +1,11 @@ +{ %fail } +procedure p(var S : RawByteString); + begin + end; + +var + s1 : UTF8String; + +begin + p(s1); +end.