-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[NFC][SpecialCaseList] Precommit Version 4 tests #167282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NFC][SpecialCaseList] Precommit Version 4 tests #167282
Conversation
Created using spr 1.3.7 [skip ci]
Created using spr 1.3.7
|
@llvm/pr-subscribers-llvm-support Author: Vitaly Buka (vitalybuka) ChangesAt the moment the behavior is no different from Full diff: https://github.com/llvm/llvm-project/pull/167282.diff 1 Files Affected:
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) {
|
At the moment the behavior is no different from Version 3. Pull Request: llvm#167282
There was a problem hiding this 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
IgnoreListvariable 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.
At the moment the behavior is no different from
Version 3.