2020-04-27 01:41:17 +02:00
|
|
|
import unittest
|
|
|
|
from ircrobots import glob
|
|
|
|
|
|
|
|
class GlobTestCollapse(unittest.TestCase):
|
|
|
|
def test(self):
|
2020-07-01 19:02:16 +02:00
|
|
|
c1 = glob.collapse("**?*")
|
2020-04-27 01:41:17 +02:00
|
|
|
self.assertEqual(c1, "?*")
|
|
|
|
|
2020-07-01 19:02:16 +02:00
|
|
|
c2 = glob.collapse("a**?a*")
|
2020-04-27 01:41:17 +02:00
|
|
|
self.assertEqual(c2, "a?*a*")
|
|
|
|
|
2020-07-01 19:02:16 +02:00
|
|
|
c3 = glob.collapse("?*?*?*?*a")
|
2020-04-27 01:41:17 +02:00
|
|
|
self.assertEqual(c3, "????*a")
|
|
|
|
|
2020-07-01 19:02:16 +02:00
|
|
|
c4 = glob.collapse("a*?*a?**")
|
2020-04-27 01:41:17 +02:00
|
|
|
self.assertEqual(c4, "a?*a?*")
|