ircrobots/test/glob.py

17 lines
412 B
Python
Raw Normal View History

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