aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/ADT/StringRefTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/ADT/StringRefTest.cpp')
-rw-r--r--llvm/unittests/ADT/StringRefTest.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/unittests/ADT/StringRefTest.cpp b/llvm/unittests/ADT/StringRefTest.cpp
index e80a25a..ac73458 100644
--- a/llvm/unittests/ADT/StringRefTest.cpp
+++ b/llvm/unittests/ADT/StringRefTest.cpp
@@ -584,6 +584,15 @@ TEST(StringRefTest, EditDistance) {
"people soiled our green "));
}
+TEST(StringRefTest, EditDistanceInsensitive) {
+ StringRef Hello("HELLO");
+ EXPECT_EQ(2U, Hello.edit_distance_insensitive("hill"));
+ EXPECT_EQ(0U, Hello.edit_distance_insensitive("hello"));
+
+ StringRef Industry("InDuStRy");
+ EXPECT_EQ(6U, Industry.edit_distance_insensitive("iNtErEsT"));
+}
+
TEST(StringRefTest, Misc) {
std::string Storage;
raw_string_ostream OS(Storage);