##// END OF EJS Templates
match: use raw strings to avoid illegal baskslash escape...
Gregory Szorc -
r42367:fd384911 default
parent child Browse files
Show More
@@ -484,7 +484,7 b' class patternmatcher(basematcher):'
484 """Matches a set of (kind, pat, source) against a 'root' directory.
484 """Matches a set of (kind, pat, source) against a 'root' directory.
485
485
486 >>> kindpats = [
486 >>> kindpats = [
487 ... (b're', b'.*\.c$', b''),
487 ... (b're', br'.*\.c$', b''),
488 ... (b'path', b'foo/a', b''),
488 ... (b'path', b'foo/a', b''),
489 ... (b'relpath', b'b', b''),
489 ... (b'relpath', b'b', b''),
490 ... (b'glob', b'*.h', b''),
490 ... (b'glob', b'*.h', b''),
@@ -651,7 +651,7 b' class exactmatcher(basematcher):'
651 r'''Matches the input files exactly. They are interpreted as paths, not
651 r'''Matches the input files exactly. They are interpreted as paths, not
652 patterns (so no kind-prefixes).
652 patterns (so no kind-prefixes).
653
653
654 >>> m = exactmatcher([b'a.txt', b're:.*\.c$'])
654 >>> m = exactmatcher([b'a.txt', br're:.*\.c$'])
655 >>> m(b'a.txt')
655 >>> m(b'a.txt')
656 True
656 True
657 >>> m(b'b.txt')
657 >>> m(b'b.txt')
@@ -664,7 +664,7 b' class exactmatcher(basematcher):'
664 So pattern 're:.*\.c$' is not considered as a regex, but as a file name
664 So pattern 're:.*\.c$' is not considered as a regex, but as a file name
665 >>> m(b'main.c')
665 >>> m(b'main.c')
666 False
666 False
667 >>> m(b're:.*\.c$')
667 >>> m(br're:.*\.c$')
668 True
668 True
669 '''
669 '''
670
670
@@ -1075,7 +1075,7 b' class unionmatcher(basematcher):'
1075 def patkind(pattern, default=None):
1075 def patkind(pattern, default=None):
1076 '''If pattern is 'kind:pat' with a known kind, return kind.
1076 '''If pattern is 'kind:pat' with a known kind, return kind.
1077
1077
1078 >>> patkind(b're:.*\.c$')
1078 >>> patkind(br're:.*\.c$')
1079 're'
1079 're'
1080 >>> patkind(b'glob:*.c')
1080 >>> patkind(b'glob:*.c')
1081 'glob'
1081 'glob'
General Comments 0
You need to be logged in to leave comments. Login now