##// END OF EJS Templates
match: add doctest examples for patkind()
Denis Laxalde -
r42251:413a75da default
parent child Browse files
Show More
@@ -1024,7 +1024,18 b' class unionmatcher(basematcher):'
1024 1024 return ('<unionmatcher matchers=%r>' % self._matchers)
1025 1025
1026 1026 def patkind(pattern, default=None):
1027 '''If pattern is 'kind:pat' with a known kind, return kind.'''
1027 '''If pattern is 'kind:pat' with a known kind, return kind.
1028
1029 >>> patkind('re:.*\.c$')
1030 're'
1031 >>> patkind('glob:*.c')
1032 'glob'
1033 >>> patkind('relpath:test.py')
1034 'relpath'
1035 >>> patkind('main.py')
1036 >>> patkind('main.py', default='re')
1037 're'
1038 '''
1028 1039 return _patsplit(pattern, default)[0]
1029 1040
1030 1041 def _patsplit(pattern, default):
General Comments 0
You need to be logged in to leave comments. Login now