+ added test for the StrUpper() and StrLower() functions in the strings unit

git-svn-id: trunk@37617 -
This commit is contained in:
nickysn 2017-11-24 15:59:20 +00:00
parent 5595a74609
commit 51489f9186

View File

@ -133,6 +133,29 @@ begin
end;
procedure teststrupperstrlower;
const
P : PChar = 'This is a PCHAR string.@AZ[`az{';
var
buf: array [0..511] of Char;
Q: PChar;
begin
StrCopy(buf, P);
Q := StrUpper(buf);
if Q <> @buf then
failed;
if strpas(buf) <> 'THIS IS A PCHAR STRING.@AZ[`AZ{' then
failed;
StrCopy(buf, P);
Q := StrLower(buf);
if Q <> @buf then
failed;
if strpas(buf) <> 'this is a pchar string.@az[`az{' then
failed;
end;
begin
write('Testing strlen ... ');
teststrlen;
@ -158,4 +181,7 @@ begin
write('Testing strscan/strrscan ... ');
teststrscanstrrscan;
writeln('Success.');
write('Testing strupper/strlower ... ');
teststrupperstrlower;
writeln('Success.');
end.