aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/ADT/StringRefTest.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2009-11-13 04:55:09 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2009-11-13 04:55:09 +0000
commitff2c72b858362bdd69c4ecb072d9b41e2db8d68e (patch)
treea308771600433e0717ad82ba87b0d4e65f3574a9 /llvm/unittests/ADT/StringRefTest.cpp
parente828c369335871bfe49b1cf07f01faf95304c299 (diff)
downloadllvm-ff2c72b858362bdd69c4ecb072d9b41e2db8d68e.zip
llvm-ff2c72b858362bdd69c4ecb072d9b41e2db8d68e.tar.gz
llvm-ff2c72b858362bdd69c4ecb072d9b41e2db8d68e.tar.bz2
Distinguish "a," from "a". The first one splits into "a" + "" and the second one into
"a" + 0. llvm-svn: 87084
Diffstat (limited to 'llvm/unittests/ADT/StringRefTest.cpp')
-rw-r--r--llvm/unittests/ADT/StringRefTest.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/unittests/ADT/StringRefTest.cpp b/llvm/unittests/ADT/StringRefTest.cpp
index ea1d26c..dfa208a 100644
--- a/llvm/unittests/ADT/StringRefTest.cpp
+++ b/llvm/unittests/ADT/StringRefTest.cpp
@@ -143,6 +143,11 @@ TEST(StringRefTest, Split2) {
StringRef(",").split(parts, ",", -1, true);
EXPECT_TRUE(parts == expected);
+ expected.clear(); parts.clear();
+ expected.push_back("a"); expected.push_back("b");
+ StringRef("a,b").split(parts, ",", -1, true);
+ EXPECT_TRUE(parts == expected);
+
// Test MaxSplit
expected.clear(); parts.clear();
expected.push_back("a,,b,c");