new API
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 2s

This commit is contained in:
2026-04-13 23:02:57 +02:00
parent a44248bc50
commit 4d115e3de4
17 changed files with 965 additions and 275 deletions

View File

@@ -1,6 +1,10 @@
from unittest import TestCase
from kpmatch import specificity
from kpmatch import compile
def specificity(pattern: str) -> int:
return compile(pattern)[0].specificity
class SpecificityTests(TestCase):
@@ -10,7 +14,6 @@ class SpecificityTests(TestCase):
self.assertGreater(specificity("**/a/file.txt"), specificity("**/a/*.txt"))
self.assertGreater(specificity("file.txt"), specificity("*.txt"))
self.assertGreater(specificity("*.txt"), specificity("*"))
self.assertGreater(specificity("file.{txt,html}"), specificity("*.txt"))
self.assertGreater(specificity("image_???.png"), specificity("image_*.png"))
self.assertGreater(specificity("image.png"), specificity("image_???.png"))