summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Option/OptionParsingTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/Option/OptionParsingTest.cpp')
-rw-r--r--llvm/unittests/Option/OptionParsingTest.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/unittests/Option/OptionParsingTest.cpp b/llvm/unittests/Option/OptionParsingTest.cpp
index f6b6b95a209..ee741c25d05 100644
--- a/llvm/unittests/Option/OptionParsingTest.cpp
+++ b/llvm/unittests/Option/OptionParsingTest.cpp
@@ -298,6 +298,11 @@ TEST(Option, FindNearest) {
EXPECT_EQ(1U, T.findNearest("/framb:foo", Nearest));
EXPECT_EQ(Nearest, "/cramb:foo");
+ // `--glormp` should have an editing distance of 1 to `--glormp=`.
+ EXPECT_EQ(1U, T.findNearest("--glormp", Nearest));
+ EXPECT_EQ(Nearest, "--glormp=");
+ EXPECT_EQ(0U, T.findNearest("--glormp=foo", Nearest));
+
// Flags should be included and excluded as specified.
EXPECT_EQ(1U, T.findNearest("-doopf", Nearest, /*FlagsToInclude=*/OptFlag2));
EXPECT_EQ(Nearest, "-doopf2");
OpenPOWER on IntegriCloud