mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 21:33:32 +02:00
+ added test for the StrUpper() and StrLower() functions in the strings unit
git-svn-id: trunk@37617 -
This commit is contained in:
parent
5595a74609
commit
51489f9186
@ -133,6 +133,29 @@ begin
|
|||||||
end;
|
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
|
begin
|
||||||
write('Testing strlen ... ');
|
write('Testing strlen ... ');
|
||||||
teststrlen;
|
teststrlen;
|
||||||
@ -158,4 +181,7 @@ begin
|
|||||||
write('Testing strscan/strrscan ... ');
|
write('Testing strscan/strrscan ... ');
|
||||||
teststrscanstrrscan;
|
teststrscanstrrscan;
|
||||||
writeln('Success.');
|
writeln('Success.');
|
||||||
|
write('Testing strupper/strlower ... ');
|
||||||
|
teststrupperstrlower;
|
||||||
|
writeln('Success.');
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user