| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
def test_wildcard_matcher(): |
| 21 |
from confluent_kafka.schema_registry.wildcard_matcher import wildcard_match |
| 22 |
|
| 23 |
assert not wildcard_match("", "Foo") |
| 24 |
assert not wildcard_match("Foo", "") |
| 25 |
assert wildcard_match("", "") |
| 26 |
assert wildcard_match("Foo", "Foo") |
| 27 |
assert wildcard_match("", "*") |
| 28 |
assert not wildcard_match("", "?") |
| 29 |
assert wildcard_match("Foo", "Fo*") |
| 30 |
assert wildcard_match("Foo", "Fo?") |
| 31 |
assert wildcard_match("Foo Bar and Catflag", "Fo*") |
| 32 |
assert wildcard_match("New Bookmarks", "N?w ?o?k??r?s") |
| 33 |
assert not wildcard_match("Foo", "Bar") |
| 34 |
assert wildcard_match("Foo Bar Foo", "F*o Bar*") |
| 35 |
assert wildcard_match("Adobe Acrobat Installer", "Ad*er") |
| 36 |
assert wildcard_match("Foo", "*Foo") |
| 37 |
assert wildcard_match("BarFoo", "*Foo") |
| 38 |
assert wildcard_match("Foo", "Foo*") |
| 39 |
assert wildcard_match("FooBar", "Foo*") |
| 40 |
assert not wildcard_match("FOO", "*Foo") |
| 41 |
assert not wildcard_match("BARFOO", "*Foo") |
| 42 |
assert not wildcard_match("FOO", "Foo*") |
| 43 |
assert not wildcard_match("FOOBAR", "Foo*") |
| 44 |
assert wildcard_match("eve", "eve*") |
| 45 |
assert wildcard_match("alice.bob.eve", "a*.bob.eve") |
| 46 |
assert not wildcard_match("alice.bob.eve", "a*") |
| 47 |
assert wildcard_match("alice.bob.eve", "a**") |
| 48 |
assert not wildcard_match("alice.bob.eve", "alice.bob*") |
| 49 |
assert wildcard_match("alice.bob.eve", "alice.bob**") |