mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-07-31 18:45:59 +02:00
54 lines
963 B
ObjectPascal
54 lines
963 B
ObjectPascal
{$APPTYPE CONSOLE}
|
|
uses
|
|
{$ifdef unix}
|
|
cwstring,
|
|
{$endif unix}
|
|
SysUtils;
|
|
|
|
type
|
|
ts866 = type string<866>;
|
|
ts850 = type string<850>;
|
|
ts1251 = type string<1251>;
|
|
var
|
|
a : ts1251;
|
|
b : ts850;
|
|
c, d : ts866;
|
|
begin
|
|
a := 'al';
|
|
b := 'b2';
|
|
d := 'd4';
|
|
|
|
//without "DestS" in the array
|
|
c := '';
|
|
c := a + b;
|
|
if (StringCodePage(c) <> 866) then
|
|
halt(1);
|
|
c := '';
|
|
c := a + d;
|
|
if (StringCodePage(c) <> 866) then
|
|
halt(2);
|
|
c := '';
|
|
c := d + b;
|
|
if (StringCodePage(c) <> 866) then
|
|
halt(3);
|
|
//with empty "DestS" in the array
|
|
c := '';
|
|
c := c + a ;
|
|
if (StringCodePage(c) <> 866) then
|
|
halt(4);
|
|
c := '';
|
|
c := c + d ;
|
|
if (StringCodePage(c) <> 866) then
|
|
halt(5);
|
|
//with "DestS" in the array at the start
|
|
c := c + a ;
|
|
if (StringCodePage(c) <> 866) then
|
|
halt(6);
|
|
//with "DestS" in the array, not at the start
|
|
c := a + c;
|
|
if (StringCodePage(c) <> 866) then
|
|
halt(7);
|
|
|
|
WriteLn('ok');
|
|
end.
|