Browse Source

+ added strscan/strrscan test

florian 21 years ago
parent
commit
54c08f4c73
1 changed files with 18 additions and 0 deletions
  1. 18 0
      tests/test/units/strings/tstrings1.pp

+ 18 - 0
tests/test/units/strings/tstrings1.pp

@@ -93,6 +93,7 @@ procedure teststrpcopy;
        failed;
   end;
 
+
 procedure teststrend;
   Const
      P : PChar = 'This is a PCHAR string.';
@@ -101,6 +102,7 @@ procedure teststrend;
        failed;
   end;
 
+
 procedure teststrcopy;
   Const
      P1 : PChar = 'This a test string 012345678901234567890123456789012345678901234567890123456789';
@@ -118,6 +120,19 @@ procedure teststrcopy;
        failed;
   end;
 
+
+procedure teststrscanstrrscan;
+  Const
+    P : PChar = 'This is a PCHAR string.';
+    S : Char = 's' ;
+begin
+  if StrComp(StrScan(P,s),'s is a PCHAR string.')<>0 then
+    failed;
+  if StrComp(StrRScan(P,s),'string.')<>0 then
+    failed;
+end;
+
+
 begin
    write('Testing strlen ... ');
    teststrlen;
@@ -140,4 +155,7 @@ begin
    write('Testing strend ... ');
    teststrend;
    writeln('Success.');
+   write('Testing strscan/strrscan ... ');
+   teststrscanstrrscan;
+   writeln('Success.');
 end.