Add support for partial redefs to the fast register allocator.
[oota-llvm.git] / unittests / ADT / StringRefTest.cpp
index 19665df88d54eb9d1e67ec85b439da7f3cbf2fc9..b0dcb0a0abababc3157e1bdaf8571b9059033ed6 100644 (file)
@@ -13,7 +13,7 @@
 #include "llvm/Support/raw_ostream.h"
 using namespace llvm;
 
-namespace {
+namespace llvm {
 
 std::ostream &operator<<(std::ostream &OS, const StringRef &S) {
   OS << S;
@@ -26,6 +26,9 @@ std::ostream &operator<<(std::ostream &OS,
   return OS;
 }
 
+}
+
+namespace {
 TEST(StringRefTest, Construction) {
   EXPECT_EQ("", StringRef());
   EXPECT_EQ("hello", StringRef("hello"));
@@ -244,6 +247,11 @@ TEST(StringRefTest, Count) {
   EXPECT_EQ(0U, Str.count("zz"));
 }
 
+TEST(StringRefTest, EditDistance) {
+  StringRef Str("hello");
+  EXPECT_EQ(2U, Str.edit_distance("hill"));
+}
+
 TEST(StringRefTest, Misc) {
   std::string Storage;
   raw_string_ostream OS(Storage);