diff options
Diffstat (limited to 'llvm/unittests/ADT/StringRefTest.cpp')
-rw-r--r-- | llvm/unittests/ADT/StringRefTest.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/unittests/ADT/StringRefTest.cpp b/llvm/unittests/ADT/StringRefTest.cpp index 9cb24bf..fbf2d84 100644 --- a/llvm/unittests/ADT/StringRefTest.cpp +++ b/llvm/unittests/ADT/StringRefTest.cpp @@ -59,6 +59,16 @@ TEST(StringRefTest, Construction) { EXPECT_EQ("hello", StringRef("hello")); EXPECT_EQ("hello", StringRef("hello world", 5)); EXPECT_EQ("hello", StringRef(std::string("hello"))); +#if __cplusplus > 201402L + EXPECT_EQ("hello", StringRef(std::string_view("hello"))); +#endif +} + +TEST(StringRefTest, Conversion) { + EXPECT_EQ("hello", std::string(StringRef("hello"))); +#if __cplusplus > 201402L + EXPECT_EQ("hello", std::string_view(StringRef("hello"))); +#endif } TEST(StringRefTest, EmptyInitializerList) { |