new path tests

This commit is contained in:
Anthony Scopatz 2016-09-25 15:07:42 -04:00
parent eff262629a
commit aff0a090ce
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,5 @@
import xonsh.completers.path as xcp
def test_pattern_need_quotes():
# just make sure the regex compiles
xcp.PATTERN_NEED_QUOTES.match('')

View file

@ -14,7 +14,7 @@ from xonsh.completers.tools import get_filter_function
def PATTERN_NEED_QUOTES():
pattern = r'\s`\$\{\}\,\*\(\)"\'\?&'
if xp.ON_WINDOWS:
pattern.append('%')
pattern += '%'
pattern = '[' + pattern + ']' + r'|\band\b|\bor\b'
return re.compile(pattern)