mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 01:27:59 +02:00
merge r13482 from cpstrnew branch by florian:
+ first tests for code page aware strings git-svn-id: trunk@19081 -
This commit is contained in:
parent
8a4634a7b1
commit
42832675d8
5
.gitattributes
vendored
5
.gitattributes
vendored
@ -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
30
tests/test/tcpstr1.pp
Normal 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
12
tests/test/tcpstr2.pp
Normal 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
13
tests/test/tcpstr2a.pp
Normal 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
11
tests/test/tcpstr3.pp
Normal 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
11
tests/test/tcpstr4.pp
Normal file
@ -0,0 +1,11 @@
|
||||
{ %fail }
|
||||
procedure p(var S : RawByteString);
|
||||
begin
|
||||
end;
|
||||
|
||||
var
|
||||
s1 : UTF8String;
|
||||
|
||||
begin
|
||||
p(s1);
|
||||
end.
|
Loading…
Reference in New Issue
Block a user