Skip to content

Commit efc83cc

Browse files
authored
[NFC][SpecialCaseList] Precommit Version 4 tests (#167282)
At the moment the behavior is no different from Version 3.
1 parent 89577e9 commit efc83cc

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

llvm/unittests/Support/SpecialCaseListTest.cpp

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -308,43 +308,49 @@ TEST_F(SpecialCaseListTest, Version2) {
308308
}
309309

310310
TEST_F(SpecialCaseListTest, DotSlash) {
311-
std::unique_ptr<SpecialCaseList> SCL2 = makeSpecialCaseList("[dot]\n"
312-
"fun:./foo\n"
313-
"src:./bar\n"
314-
"[not]\n"
315-
"fun:foo\n"
316-
"src:bar\n");
317-
std::unique_ptr<SpecialCaseList> SCL3 = makeSpecialCaseList("[dot]\n"
318-
"fun:./foo\n"
319-
"src:./bar\n"
320-
"[not]\n"
321-
"fun:foo\n"
322-
"src:bar\n",
323-
/*Version=*/3);
311+
StringRef IgnoreList = "[dot]\n"
312+
"fun:./foo\n"
313+
"src:./bar\n"
314+
"[not]\n"
315+
"fun:foo\n"
316+
"src:bar\n";
317+
std::unique_ptr<SpecialCaseList> SCL2 = makeSpecialCaseList(IgnoreList);
318+
std::unique_ptr<SpecialCaseList> SCL3 =
319+
makeSpecialCaseList(IgnoreList, /*Version=*/3);
320+
std::unique_ptr<SpecialCaseList> SCL4 = makeSpecialCaseList(IgnoreList,
321+
/*Version=*/4);
324322

325323
EXPECT_TRUE(SCL2->inSection("dot", "fun", "./foo"));
326324
EXPECT_TRUE(SCL3->inSection("dot", "fun", "./foo"));
325+
EXPECT_TRUE(SCL4->inSection("dot", "fun", "./foo"));
327326

328327
EXPECT_FALSE(SCL2->inSection("dot", "fun", "foo"));
329328
EXPECT_FALSE(SCL3->inSection("dot", "fun", "foo"));
329+
EXPECT_FALSE(SCL4->inSection("dot", "fun", "foo"));
330330

331331
EXPECT_TRUE(SCL2->inSection("dot", "src", "./bar"));
332332
EXPECT_FALSE(SCL3->inSection("dot", "src", "./bar"));
333+
EXPECT_FALSE(SCL4->inSection("dot", "src", "./bar"));
333334

334335
EXPECT_FALSE(SCL2->inSection("dot", "src", "bar"));
335336
EXPECT_FALSE(SCL3->inSection("dot", "src", "bar"));
337+
EXPECT_FALSE(SCL4->inSection("dot", "src", "bar"));
336338

337339
EXPECT_FALSE(SCL2->inSection("not", "fun", "./foo"));
338340
EXPECT_FALSE(SCL3->inSection("not", "fun", "./foo"));
341+
EXPECT_FALSE(SCL4->inSection("not", "fun", "./foo"));
339342

340343
EXPECT_TRUE(SCL2->inSection("not", "fun", "foo"));
341344
EXPECT_TRUE(SCL3->inSection("not", "fun", "foo"));
345+
EXPECT_TRUE(SCL4->inSection("not", "fun", "foo"));
342346

343347
EXPECT_FALSE(SCL2->inSection("not", "src", "./bar"));
344348
EXPECT_TRUE(SCL3->inSection("not", "src", "./bar"));
349+
EXPECT_TRUE(SCL4->inSection("not", "src", "./bar"));
345350

346351
EXPECT_TRUE(SCL2->inSection("not", "src", "bar"));
347352
EXPECT_TRUE(SCL3->inSection("not", "src", "bar"));
353+
EXPECT_TRUE(SCL4->inSection("not", "src", "bar"));
348354
}
349355

350356
TEST_F(SpecialCaseListTest, LinesInSection) {

0 commit comments

Comments
 (0)