| 895 | } |
| 896 | |
| 897 | static 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 | |
| 920 | static bool testMethod_rfind() |
| 921 | { |