mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-05-17 22:42:34 +02:00
45 lines
846 B
ObjectPascal
45 lines
846 B
ObjectPascal
{$APPTYPE CONSOLE}
|
|
// test "fpc_AnsiStr_Concat_multi" with a same type(same encoding)
|
|
uses
|
|
{$ifdef unix}
|
|
{$ifdef darwin}iosxwstr{$else}cwstring{$endif},
|
|
{$endif unix}
|
|
SysUtils;
|
|
|
|
const
|
|
{$ifdef android}
|
|
cp = 1251;
|
|
{$else}
|
|
cp = 866;
|
|
{$endif android}
|
|
|
|
type
|
|
ts866 = type AnsiString(cp);
|
|
var
|
|
a, b, c, d : ts866;
|
|
begin
|
|
a := 'al';
|
|
b := 'b2';
|
|
c := 'c3';
|
|
|
|
//without "DestS" in the array
|
|
d := a + b + c;
|
|
if (StringCodePage(d) <> cp) then
|
|
halt(1);
|
|
//with empty "DestS" in the array
|
|
d := '';
|
|
d := d + a + b + c;
|
|
if (StringCodePage(d) <> cp) then
|
|
halt(2);
|
|
//with "DestS" in the array at the start
|
|
d := d + b + c;
|
|
if (StringCodePage(d) <> cp) then
|
|
halt(3);
|
|
//with "DestS" in the array, not at the start
|
|
d := a + b + d + c;
|
|
if (StringCodePage(d) <> cp) then
|
|
halt(4);
|
|
|
|
WriteLn('ok');
|
|
end.
|