fpc/tests/webtbs/tw6737.pp
peter c020d709b4 * default widestring-ansistring conversion needs to use the same algorithm
as the rtl to behave the same on compile time and runtime

git-svn-id: trunk@8161 -
2007-07-23 21:57:48 +00:00

32 lines
597 B
ObjectPascal

{$mode objfpc}
{$H+}
uses sysutils;
Function AnsiEndsStr(const ASubText, AText: string): Boolean;
begin
Writeln('ZZ',ASubText,'XX ',AText,'YY');
Result := AnsiCompareStr(Copy(AText,length(AText)-length(ASubText)+1,length(ASubText)),ASubText)=0;
end;
VAR
s: WideString;
t: WideString;
err : boolean;
BEGIN
s := 'This is a test.'#961#967;
t := 'test.'#961#967;
IF AnsiEndsStr(t, s) THEN
WriteLn('OK.')
ELSE
err:=true;
IF AnsiEndsStr('test.'#961#967, s) THEN
WriteLn('OK.')
ELSE
err:=true;
if err then
WriteLn('Not OK.');
if err then
halt(1);
END.