forked from qt-creator/qt-creator
Utils: Add startWith to string view
We will add more function if they are needed. Change-Id: Iac6b432327be32a0778a82c23ed2de5996c555a1 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -866,6 +866,19 @@ TEST(SmallString, StartsWith)
|
||||
{
|
||||
SmallString text("$column");
|
||||
|
||||
ASSERT_FALSE(text.startsWith("$columnxxx"));
|
||||
ASSERT_TRUE(text.startsWith("$column"));
|
||||
ASSERT_TRUE(text.startsWith("$col"));
|
||||
ASSERT_FALSE(text.startsWith("col"));
|
||||
ASSERT_TRUE(text.startsWith('$'));
|
||||
ASSERT_FALSE(text.startsWith('@'));
|
||||
}
|
||||
|
||||
TEST(SmallString, StartsWithStringView)
|
||||
{
|
||||
SmallStringView text("$column");
|
||||
|
||||
ASSERT_FALSE(text.startsWith("$columnxxx"));
|
||||
ASSERT_TRUE(text.startsWith("$column"));
|
||||
ASSERT_TRUE(text.startsWith("$col"));
|
||||
ASSERT_FALSE(text.startsWith("col"));
|
||||
|
||||
Reference in New Issue
Block a user