[llvm] 16b2569 - [unittest] Add [*] test to GlobPatternTest.cpp

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 25 18:31:13 PDT 2023


Author: Fangrui Song
Date: 2023-07-25T18:31:09-07:00
New Revision: 16b2569f8e74f93070860b803efdc54367b3ed31

URL: https://github.com/llvm/llvm-project/commit/16b2569f8e74f93070860b803efdc54367b3ed31
DIFF: https://github.com/llvm/llvm-project/commit/16b2569f8e74f93070860b803efdc54367b3ed31.diff

LOG: [unittest] Add [*] test to GlobPatternTest.cpp

Added: 
    

Modified: 
    llvm/unittests/Support/GlobPatternTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/Support/GlobPatternTest.cpp b/llvm/unittests/Support/GlobPatternTest.cpp
index 1bf5eae54a627d..81d358e0c47aa4 100644
--- a/llvm/unittests/Support/GlobPatternTest.cpp
+++ b/llvm/unittests/Support/GlobPatternTest.cpp
@@ -118,6 +118,11 @@ TEST_F(GlobPatternTest, SpecialCharsInCharacterClass) {
   EXPECT_TRUE(Pat1->match("^"));
   EXPECT_FALSE(Pat1->match("*?^"));
   EXPECT_FALSE(Pat1->match(""));
+
+  Expected<GlobPattern> Pat2 = GlobPattern::create("[*]");
+  ASSERT_TRUE((bool)Pat2);
+  EXPECT_TRUE(Pat2->match("*"));
+  EXPECT_FALSE(Pat2->match("]"));
 }
 
 TEST_F(GlobPatternTest, Invalid) {


        


More information about the llvm-commits mailing list