Skip to content

Conversation

@vitalybuka
Copy link
Collaborator

At the moment the behavior is no different from
Version 3.

@llvmbot
Copy link
Member

llvmbot commented Nov 10, 2025

@llvm/pr-subscribers-llvm-support

Author: Vitaly Buka (vitalybuka)

Changes

At the moment the behavior is no different from
Version 3.


Full diff: https://github.com/llvm/llvm-project/pull/167282.diff

1 Files Affected:

  • (modified) llvm/unittests/Support/SpecialCaseListTest.cpp (+19-13)
diff --git a/llvm/unittests/Support/SpecialCaseListTest.cpp b/llvm/unittests/Support/SpecialCaseListTest.cpp
index 750fedaf0a436..812e0d3d8520c 100644
--- a/llvm/unittests/Support/SpecialCaseListTest.cpp
+++ b/llvm/unittests/Support/SpecialCaseListTest.cpp
@@ -308,43 +308,49 @@ TEST_F(SpecialCaseListTest, Version2) {
 }
 
 TEST_F(SpecialCaseListTest, DotSlash) {
-  std::unique_ptr<SpecialCaseList> SCL2 = makeSpecialCaseList("[dot]\n"
-                                                              "fun:./foo\n"
-                                                              "src:./bar\n"
-                                                              "[not]\n"
-                                                              "fun:foo\n"
-                                                              "src:bar\n");
-  std::unique_ptr<SpecialCaseList> SCL3 = makeSpecialCaseList("[dot]\n"
-                                                              "fun:./foo\n"
-                                                              "src:./bar\n"
-                                                              "[not]\n"
-                                                              "fun:foo\n"
-                                                              "src:bar\n",
-                                                              /*Version=*/3);
+  StringRef IgnoreList = "[dot]\n"
+                         "fun:./foo\n"
+                         "src:./bar\n"
+                         "[not]\n"
+                         "fun:foo\n"
+                         "src:bar\n";
+  std::unique_ptr<SpecialCaseList> SCL2 = makeSpecialCaseList(IgnoreList);
+  std::unique_ptr<SpecialCaseList> SCL3 =
+      makeSpecialCaseList(IgnoreList, /*Version=*/3);
+  std::unique_ptr<SpecialCaseList> SCL4 = makeSpecialCaseList(IgnoreList,
+                                                              /*Version=*/4);
 
   EXPECT_TRUE(SCL2->inSection("dot", "fun", "./foo"));
   EXPECT_TRUE(SCL3->inSection("dot", "fun", "./foo"));
+  EXPECT_TRUE(SCL4->inSection("dot", "fun", "./foo"));
 
   EXPECT_FALSE(SCL2->inSection("dot", "fun", "foo"));
   EXPECT_FALSE(SCL3->inSection("dot", "fun", "foo"));
+  EXPECT_FALSE(SCL4->inSection("dot", "fun", "foo"));
 
   EXPECT_TRUE(SCL2->inSection("dot", "src", "./bar"));
   EXPECT_FALSE(SCL3->inSection("dot", "src", "./bar"));
+  EXPECT_FALSE(SCL4->inSection("dot", "src", "./bar"));
 
   EXPECT_FALSE(SCL2->inSection("dot", "src", "bar"));
   EXPECT_FALSE(SCL3->inSection("dot", "src", "bar"));
+  EXPECT_FALSE(SCL4->inSection("dot", "src", "bar"));
 
   EXPECT_FALSE(SCL2->inSection("not", "fun", "./foo"));
   EXPECT_FALSE(SCL3->inSection("not", "fun", "./foo"));
+  EXPECT_FALSE(SCL4->inSection("not", "fun", "./foo"));
 
   EXPECT_TRUE(SCL2->inSection("not", "fun", "foo"));
   EXPECT_TRUE(SCL3->inSection("not", "fun", "foo"));
+  EXPECT_TRUE(SCL4->inSection("not", "fun", "foo"));
 
   EXPECT_FALSE(SCL2->inSection("not", "src", "./bar"));
   EXPECT_TRUE(SCL3->inSection("not", "src", "./bar"));
+  EXPECT_TRUE(SCL4->inSection("not", "src", "./bar"));
 
   EXPECT_TRUE(SCL2->inSection("not", "src", "bar"));
   EXPECT_TRUE(SCL3->inSection("not", "src", "bar"));
+  EXPECT_TRUE(SCL4->inSection("not", "src", "bar"));
 }
 
 TEST_F(SpecialCaseListTest, LinesInSection) {

vitalybuka added a commit to vitalybuka/llvm-project that referenced this pull request Nov 10, 2025
At the moment the behavior is no different from
Version 3.

Pull Request: llvm#167282
@vitalybuka vitalybuka requested a review from Copilot November 10, 2025 18:55
@vitalybuka vitalybuka changed the base branch from users/vitalybuka/spr/main.nfcspecialcaselist-precommit-version-4-tests to main November 10, 2025 18:55
Created using spr 1.3.7
@vitalybuka vitalybuka enabled auto-merge (squash) November 10, 2025 18:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the DotSlash test to reduce code duplication and adds test coverage for version 4 of the SpecialCaseList format. The test now uses a shared IgnoreList variable instead of duplicating the list string, and includes SCL4 to verify that version 4 behaves the same as version 3.

  • Extracted the ignore list string into a shared IgnoreList variable to eliminate duplication
  • Added SCL4 to test version 4 of the SpecialCaseList format
  • Added corresponding assertions for SCL4 across all test cases

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vitalybuka vitalybuka merged commit efc83cc into main Nov 10, 2025
9 of 10 checks passed
@vitalybuka vitalybuka deleted the users/vitalybuka/spr/nfcspecialcaselist-precommit-version-4-tests branch November 10, 2025 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants