merge r13482 from cpstrnew branch by florian:

+ first tests for code page aware strings

git-svn-id: trunk@19081 -
This commit is contained in:
paul 2011-09-17 10:40:45 +00:00
parent 8a4634a7b1
commit 42832675d8
6 changed files with 82 additions and 0 deletions

5
.gitattributes vendored
View File

@ -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

30
tests/test/tcpstr1.pp Normal file
View File

@ -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.

12
tests/test/tcpstr2.pp Normal file
View File

@ -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.

13
tests/test/tcpstr2a.pp Normal file
View File

@ -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.

11
tests/test/tcpstr3.pp Normal file
View File

@ -0,0 +1,11 @@
{ %fail }
procedure p(var S : RawByteString);
begin
end;
var
s1 : ansistring;
begin
p(s1);
end.

11
tests/test/tcpstr4.pp Normal file
View File

@ -0,0 +1,11 @@
{ %fail }
procedure p(var S : RawByteString);
begin
end;
var
s1 : UTF8String;
begin
p(s1);
end.