1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 10:11:47 +02:00
This commit is contained in:
Brian Camacho 2024-11-18 01:15:02 -05:00
parent 6d0043902a
commit b548e5c4c5

View file

@ -251,31 +251,22 @@ protected:
Fetch fetch2; Fetch fetch2;
}; };
// Test exact match pattern
TEST_F(FetchAttributeTest, ExactMatch) { TEST_F(FetchAttributeTest, ExactMatch) {
EXPECT_TRUE(fetch1.hasAttribute("litfile", "filter", "lfs")); EXPECT_TRUE(fetch1.hasAttribute("litfile", "filter", "lfs"));
EXPECT_FALSE(fetch1.hasAttribute("other", "filter", "lfs")); EXPECT_FALSE(fetch1.hasAttribute("other", "filter", "lfs"));
} }
// Test wildcard pattern
TEST_F(FetchAttributeTest, WildcardMatch) { TEST_F(FetchAttributeTest, WildcardMatch) {
EXPECT_TRUE(fetch2.hasAttribute("match.wildcard", "filter", "lfs")); EXPECT_TRUE(fetch2.hasAttribute("match.wildcard", "filter", "lfs"));
EXPECT_FALSE(fetch2.hasAttribute("nomatch.otherext", "filter", "lfs")); EXPECT_FALSE(fetch2.hasAttribute("nomatch.otherext", "filter", "lfs"));
EXPECT_FALSE(fetch2.hasAttribute("nomatch.wildcard.extra", "filter", "lfs")); EXPECT_FALSE(fetch2.hasAttribute("nomatch.wildcard.extra", "filter", "lfs"));
} }
// Test empty path
TEST_F(FetchAttributeTest, EmptyPath) { TEST_F(FetchAttributeTest, EmptyPath) {
EXPECT_FALSE(fetch1.hasAttribute("", "filter", "lfs")); EXPECT_FALSE(fetch1.hasAttribute("", "filter", "lfs"));
EXPECT_FALSE(fetch2.hasAttribute("", "filter", "lfs")); EXPECT_FALSE(fetch2.hasAttribute("", "filter", "lfs"));
} }
// Test case sensitivity
TEST_F(FetchAttributeTest, CaseSensitivity) {
EXPECT_FALSE(fetch1.hasAttribute("LITFILE", "filter", "lfs"));
EXPECT_FALSE(fetch2.hasAttribute("file.CHUNG", "filter", "lfs"));
}
} // namespace lfs } // namespace lfs