diff options
Diffstat (limited to 'test/libapt/stringview_test.cc')
-rw-r--r-- | test/libapt/stringview_test.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/libapt/stringview_test.cc b/test/libapt/stringview_test.cc index bac69ec2e..a4b7d77e3 100644 --- a/test/libapt/stringview_test.cc +++ b/test/libapt/stringview_test.cc @@ -25,8 +25,8 @@ TEST(StringViewTest,EmptyString) APT::StringView charp2String{charp}; EXPECT_EQ(0, strString.length()); - constexpr APT::StringView charaString{""}; - static_assert( 0 == charaString.length(), "chara right size"); + const APT::StringView charaString{""}; + EXPECT_EQ(0, charaString.length()); EXPECT_TRUE(APT::StringView("") == ""); EXPECT_FALSE(APT::StringView("") != ""); @@ -44,15 +44,15 @@ TEST(StringViewTest,FooString) constexpr char const * const charp = "foo"; constexpr APT::StringView charpString{charp, 3}; - static_assert( 3 == charpString.length(), "charp right size"); + EXPECT_EQ( 3, charpString.length()); EXPECT_EQ(charpString.to_string(), charpString.data()); APT::StringView charp2String{charp}; EXPECT_EQ(3, charp2String.length()); EXPECT_EQ(charp2String.to_string(), charp2String.data()); - constexpr APT::StringView charaString{"foo"}; - static_assert( 3 == charaString.length(), "chara right size"); + const APT::StringView charaString{"foo"}; + EXPECT_EQ(3, charaString.length()); EXPECT_EQ(charaString.to_string(), charaString.data()); EXPECT_TRUE(APT::StringView("foo") == "foo"); @@ -61,7 +61,7 @@ TEST(StringViewTest,FooString) TEST(StringViewTest,SubStr) { - constexpr APT::StringView defString("Hello World!"); + const APT::StringView defString("Hello World!"); EXPECT_EQ(defString.to_string().substr(6), defString.substr(6).to_string()); EXPECT_EQ(defString.to_string().substr(0,5), defString.substr(0,5).to_string()); EXPECT_EQ(defString.to_string().substr(6,5), defString.substr(6,5).to_string()); @@ -69,7 +69,7 @@ TEST(StringViewTest,SubStr) TEST(StringViewTest,Find) { - constexpr APT::StringView defString("Hello World!"); + const APT::StringView defString("Hello World!"); EXPECT_EQ(defString.to_string().find('l'), defString.find('l')); EXPECT_EQ(defString.to_string().find('X'), defString.find('X')); EXPECT_EQ(defString.to_string().find('e',3), defString.find('e',3)); @@ -79,7 +79,7 @@ TEST(StringViewTest,Find) TEST(StringViewTest,RFind) { - constexpr APT::StringView defString("Hello World!"); + const APT::StringView defString("Hello World!"); EXPECT_EQ(defString.to_string().rfind('l'), defString.rfind('l')); EXPECT_EQ(defString.to_string().rfind('X'), defString.rfind('X')); EXPECT_EQ(defString.to_string().rfind('e',3), defString.rfind('e',3)); |