##// END OF EJS Templates
run-tests: make it possible to combine (esc) with (glob) and (re)...
Mads Kiilerich -
r17778:80fe6458 default
parent child Browse files
Show More
@@ -526,14 +526,14 b' def globmatch(el, l):'
526 526 def linematch(el, l):
527 527 if el == l: # perfect match (fast)
528 528 return True
529 if (el and
530 (el.endswith(" (re)\n") and rematch(el[:-6], l) or
531 el.endswith(" (glob)\n") and globmatch(el[:-8], l) or
532 el.endswith(" (esc)\n") and
533 (el[:-7].decode('string-escape') + '\n' == l or
534 os.name == 'nt' and
535 el[:-7].decode('string-escape') + '\n' == l))):
536 return True
529 if el:
530 if el.endswith(" (esc)\n"):
531 el = el[:-7].decode('string-escape') + '\n'
532 if el == l or os.name == 'nt' and el[:-1] + '\r\n' == l:
533 return True
534 if (el.endswith(" (re)\n") and rematch(el[:-6], l) or
535 el.endswith(" (glob)\n") and globmatch(el[:-8], l)):
536 return True
537 537 return False
538 538
539 539 def tsttest(test, wd, options, replacements):
@@ -62,6 +62,18 b' Windows: \\r\\n is handled like \\n and can'
62 62 crcrlf\r (esc)
63 63 #endif
64 64
65 Combining esc with other markups - and handling lines ending with \r instead of \n:
66
67 $ printf 'foo/bar\r'
68 foo/bar\r (no-eol) (glob) (esc)
69 #if windows
70 $ printf 'foo\\bar\r'
71 foo/bar\r (no-eol) (glob) (esc)
72 #endif
73 $ printf 'foo/bar\rfoo/bar\r'
74 foo.bar\r \(no-eol\) (re) (esc)
75 foo.bar\r \(no-eol\) (re)
76
65 77 testing hghave
66 78
67 79 $ "$TESTDIR/hghave" true
General Comments 0
You need to be logged in to leave comments. Login now