summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/webtbs/tw4199.pp
blob: 6416f9961383ff1ae835d63cb659b999e71052ab (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
{$ifdef fpc}
{$mode objfpc}{$H+}
{$endif}
uses
  Classes, SysUtils;
const
 stringconst = 'abc';
 widestringconst = widestring('abc');
var
 str1,str2 : widestring;
begin
 writeln('1 ',stringconst);             //ok
 writeln('2 ',widestring(stringconst)); //ok
 writeln('3 ',widestringconst);         //bad
 str1:= widestringconst;
 writeln('4 ',str1);                    //bad
 str2:= copy(widestringconst,1,3);
 writeln('5 ',str2);                    //bad
 if widestringconst<>stringconst then
   halt(1);
 if str1<>stringconst then
   halt(2);
 if str2<>stringconst then
   halt(3);
end.