MCPcopy Create free account
hub / github.com/Kitware/CMake / testMethod_find

Function testMethod_find

Tests/CMakeLib/testString.cxx:897–918  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

895}
896
897static bool testMethod_find()
898{
899 std::cout << "testMethod_find()\n";
900 cm::String str = "abcabc";
901 ASSERT_TRUE(str.find("a") == 0);
902 ASSERT_TRUE(str.find("a", 1) == 3);
903 {
904 char const* a = "a";
905 ASSERT_TRUE(str.find(a) == 0);
906 ASSERT_TRUE(str.find(a, 1) == 3);
907 }
908 ASSERT_TRUE(str.find('a') == 0);
909 ASSERT_TRUE(str.find('a', 1) == 3);
910 ASSERT_TRUE(str.find(std::string("a")) == 0);
911 ASSERT_TRUE(str.find(std::string("a"), 1) == 3);
912 ASSERT_TRUE(str.find(cm::string_view("a_", 1)) == 0);
913 ASSERT_TRUE(str.find(cm::string_view("a_", 1), 1) == 3);
914 ASSERT_TRUE(str.find(cm::String("a")) == 0);
915 ASSERT_TRUE(str.find(cm::String("a"), 1) == 3);
916 ASSERT_TRUE(str.find("ab_", 1, 2) == 3);
917 return true;
918}
919
920static bool testMethod_rfind()
921{

Callers

nothing calls this directly

Calls 2

StringFunction · 0.85
findMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…