Beispiel #1
0
bool TestExtMb::test_mb_substr_count() {
  VS(f_mb_substr_count("This is a test", "is"), 2);
  String text = "This is a test";
  VS(f_mb_substr_count(text, "is"), 2);

  // different from substr_count
  VS(f_mb_substr_count("gcdgcdgcd", "gcdgcd"), 2);
  return Count(true);
}
bool TestExtMb::test_mb_substr_count() {
  VS(f_mb_substr_count("This is a test", "is"), 2);
  String text = "This is a test";
  VS(f_mb_substr_count(text, "is"), 2);

  // different from substr_count
  // f_mb_strrchr behaves differently in different versions of
  // libmbfl (https://github.com/facebook/hiphop-php/issues/68)
  VERIFY(f_mb_substr_count("gcdgcdgcd", "gcdgcd").same(2) ||
         f_mb_substr_count("gcdgcdgcd", "gcdgcd").same(1));
  return Count(true);
}