summaryrefslogtreecommitdiff
path: root/tests/test/tcpstr16.pp
blob: 01ebd894a3e9c6aef044867ab9ddcbc9986f4119 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
program tcpstr16;
{$mode delphi}
{$codepage cp1251}
{$apptype console}
type
  T866String = type AnsiString(866);
  T1251String = type AnsiString(1251);

function Compare(const S1, S2: RawByteString): Boolean;
begin
  Result :=
    (Length(S1) = Length(S2)) and
    (CompareByte(S1[1],S2[1],Length(S1))=0);
end;

begin
  if Compare(T866String('привет'), 'привет') then
    halt(1);
  if not Compare(AnsiString(T866String('привет')), 'привет') then
    halt(2);
end.