test: Add test case for relative exclusion matcher

This commit is contained in:
abhisek 2025-10-01 13:51:58 +05:30
parent 7f8b335393
commit c2cb4375f8
No known key found for this signature in database
GPG Key ID: CB92A4990C02A88F

View File

@ -93,6 +93,18 @@ func TestExcludedPath(t *testing.T) {
patterns: []string{"**/requirements.txt"},
shouldBeExcluded: true,
},
{
name: "path relative files does not match without double star",
path: "/tmp/some/dir/our-dir/package-lock.json",
patterns: []string{"our-dir/package-lock.json"},
shouldBeExcluded: false,
},
{
name: "path relative files should match in tmp directory as well",
path: "/tmp/some/dir/our-dir/package-lock.json",
patterns: []string{"**/our-dir/package-lock.json"},
shouldBeExcluded: true,
},
}
for _, tc := range cases {