| 268 | static auto const staticStringView = "abc"_s; |
| 269 | |
| 270 | static bool testFromStaticStringView(cm::String str) |
| 271 | { |
| 272 | cm::String const& str_const = str; |
| 273 | ASSERT_TRUE(str_const.data() == staticStringView.data()); |
| 274 | ASSERT_TRUE(str_const.size() == staticStringView.size()); |
| 275 | ASSERT_TRUE(!str_const.is_stable()); |
| 276 | ASSERT_TRUE(str.c_str() == staticStringView); |
| 277 | ASSERT_TRUE(!str.is_stable()); |
| 278 | cm::String substr = str.substr(1); |
| 279 | cm::String const& substr_const = substr; |
| 280 | ASSERT_TRUE(substr_const.data() == &staticStringView[1]); |
| 281 | ASSERT_TRUE(substr_const.size() == 2); |
| 282 | ASSERT_TRUE(!substr_const.is_stable()); |
| 283 | ASSERT_TRUE(substr.c_str() == &staticStringView[1]); |
| 284 | ASSERT_TRUE(!substr.is_stable()); |
| 285 | return true; |
| 286 | } |
| 287 | |
| 288 | static bool testConstructFromStaticStringView() |
| 289 | { |
no test coverage detected
searching dependent graphs…