[llvm] r193550 - Add a few tests for StringRef::{start,end}with.
Rui Ueyama
ruiu at google.com
Mon Oct 28 15:42:54 PDT 2013
Author: ruiu
Date: Mon Oct 28 17:42:54 2013
New Revision: 193550
URL: http://llvm.org/viewvc/llvm-project?rev=193550&view=rev
Log:
Add a few tests for StringRef::{start,end}with.
Modified:
llvm/trunk/unittests/ADT/StringRefTest.cpp
Modified: llvm/trunk/unittests/ADT/StringRefTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/StringRefTest.cpp?rev=193550&r1=193549&r2=193550&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/StringRefTest.cpp (original)
+++ llvm/trunk/unittests/ADT/StringRefTest.cpp Mon Oct 28 17:42:54 2013
@@ -248,6 +248,7 @@ TEST(StringRefTest, Trim) {
TEST(StringRefTest, StartsWith) {
StringRef Str("hello");
+ EXPECT_TRUE(Str.startswith(""));
EXPECT_TRUE(Str.startswith("he"));
EXPECT_FALSE(Str.startswith("helloworld"));
EXPECT_FALSE(Str.startswith("hi"));
@@ -255,6 +256,7 @@ TEST(StringRefTest, StartsWith) {
TEST(StringRefTest, EndsWith) {
StringRef Str("hello");
+ EXPECT_TRUE(Str.endswith(""));
EXPECT_TRUE(Str.endswith("lo"));
EXPECT_FALSE(Str.endswith("helloworld"));
EXPECT_FALSE(Str.endswith("worldhello"));
More information about the llvm-commits
mailing list