tw39885.pp 608 B

12345678910111213141516171819202122232425
  1. uses
  2. strutils;
  3. Var
  4. matches: SizeIntArray;
  5. i : Longint;
  6. begin
  7. FindMatchesBoyerMooreCaseSensitive('a x b x c', 'x', matches, {matchAll}true); // never returns
  8. if matches[0]<>3 then
  9. halt(1);
  10. if matches[1]<>7 then
  11. halt(1);
  12. FindMatchesBoyerMooreCaseSensitive('a xx b xx c', 'xx', matches, {matchAll}true); // never returns
  13. if matches[0]<>3 then
  14. halt(1);
  15. if matches[1]<>8 then
  16. halt(1);
  17. FindMatchesBoyerMooreCaseSensitive('a xy b xy c', 'xy', matches, {matchAll}true); // ok
  18. if matches[0]<>3 then
  19. halt(1);
  20. if matches[1]<>8 then
  21. halt(1);
  22. writeln('ok');
  23. end.