add start of hostmask matching: mask collapsing
This commit is contained in:
parent
024deb8d0f
commit
8afadd1fdf
3 changed files with 37 additions and 0 deletions
1
test/__init__.py
Normal file
1
test/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
from .glob import *
|
16
test/glob.py
Normal file
16
test/glob.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
import unittest
|
||||
from ircrobots import glob
|
||||
|
||||
class GlobTestCollapse(unittest.TestCase):
|
||||
def test(self):
|
||||
c1 = glob._collapse("**?*")
|
||||
self.assertEqual(c1, "?*")
|
||||
|
||||
c2 = glob._collapse("a**?a*")
|
||||
self.assertEqual(c2, "a?*a*")
|
||||
|
||||
c3 = glob._collapse("?*?*?*?*a")
|
||||
self.assertEqual(c3, "????*a")
|
||||
|
||||
c4 = glob._collapse("a*?*a?**")
|
||||
self.assertEqual(c4, "a?*a?*")
|
Loading…
Add table
Add a link
Reference in a new issue