# HG changeset patch # User Mads Kiilerich # Date 2014-04-13 20:00:08 # Node ID 03782d2fc7764186ce06f864e6819880d8695b9e # Parent 9d28fd7952157a43995077fd6873cd5e7ee8453b match: _globre doctests diff --git a/mercurial/match.py b/mercurial/match.py --- a/mercurial/match.py +++ b/mercurial/match.py @@ -228,7 +228,21 @@ def _patsplit(pattern, default): return default, pattern def _globre(pat): - '''Convert an extended glob string to a regexp string.''' + r'''Convert an extended glob string to a regexp string. + + >>> print _globre(r'?') + . + >>> print _globre(r'*') + [^/]* + >>> print _globre(r'**') + .* + >>> print _globre(r'[a*?!^][^b][!c]') + [a*?!^][\^b][^c] + >>> print _globre(r'{a,b}') + (?:a|b) + >>> print _globre(r'.\*\?') + \.\*\? + ''' i, n = 0, len(pat) res = '' group = 0