mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-19 20:39:25 +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;
|
||||
|
||||
|
||||
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.
|
||||
|
Loading…
Reference in New Issue
Block a user