summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/webtbs/tw12993.pp
blob: 05869feb17f218db926f7406db0d64c45ce0d69d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{$codepage cp866}

{ warning: this test will terminate successfully when run on systems that do
  not support the character used below in the current code page, even if the
  used compiler is buggy. On other systems, the test will properly fail if
  the compiler is buggy.
}

{$ifdef unix}
uses
  cwstring;
{$endif}
var
  s: ansistring;
  ws, ws3: widestring;
begin
    // must not be converted
    s := '£';
    if (length(s)<>1) or
       (s[1]<> #163) then
      halt(1);

    ws := '££';
    writeln(ws);
    s:=ws;
    ws:=s;

    ws3 := '£';
    if ws3[1]<>ws[1] then
      halt(2);
    writeln(ws3);
    s:=ws3;
    ws3:=s;

    delete(ws,1,1);

    if (ws<>ws3) then
      halt(3);
end.