Skip to content
Snippets Groups Projects
Commit f78f3054 authored by Yuya Nishihara's avatar Yuya Nishihara
Browse files

hgignore: add escape syntax test for glob patterns

The last example, [\#], is what the rust implementation fails to parse.
The other escapes can be removed by regexp engine or _globre().
parent c67e3f96
No related branches found
No related tags found
No related merge requests found
...@@ -90,5 +90,5 @@ ...@@ -90,5 +90,5 @@
Ensure that comments work: Ensure that comments work:
$ touch 'foo#bar' 'quux#' $ touch 'foo#bar' 'quux#' 'quu0#'
#if no-windows #if no-windows
...@@ -94,3 +94,3 @@ ...@@ -94,3 +94,3 @@
#if no-windows #if no-windows
$ touch 'baz\wat' 'ba0\#wat' 'ba1\\wat' $ touch 'baz\' 'baz\wat' 'ba0\#wat' 'ba1\\' 'ba1\\wat' 'quu0\'
#endif #endif
...@@ -96,4 +96,5 @@ ...@@ -96,4 +96,5 @@
#endif #endif
$ cat <<'EOF' >> .hgignore $ cat <<'EOF' >> .hgignore
> # full-line comment > # full-line comment
> # whitespace-only comment line > # whitespace-only comment line
...@@ -108,5 +109,27 @@ ...@@ -108,5 +109,27 @@
$ hg status $ hg status
A dir/b.o A dir/b.o
? .hgignore ? .hgignore
$ rm 'foo#bar' 'quux#' ? quu0#
? quu0\ (no-windows !)
$ cat <<'EOF' > .hgignore
> .*\.o
> syntax: glob
> syntax# pattern, no whitespace, then comment
> a.c # pattern, then whitespace, then comment
> baz\\#* # (escaped) backslash, then comment
> ba0\\\#w* # (escaped) backslash, escaped comment character, then comment
> ba1\\\\#* # (escaped) backslashes, then comment
> foo\#b* # escaped comment character
> quux\## escaped comment character at end of name
> quu0[\#]# escaped comment character inside [...]
> EOF
$ hg status
A dir/b.o
? .hgignore
? ba1\\wat (no-windows !)
? baz\wat (no-windows !)
? quu0\ (no-windows !)
$ rm 'foo#bar' 'quux#' 'quu0#'
#if no-windows #if no-windows
...@@ -112,5 +135,5 @@ ...@@ -112,5 +135,5 @@
#if no-windows #if no-windows
$ rm 'baz\wat' 'ba0\#wat' 'ba1\\wat' $ rm 'baz\' 'baz\wat' 'ba0\#wat' 'ba1\\' 'ba1\\wat' 'quu0\'
#endif #endif
Check that '^\.' does not ignore the root directory: Check that '^\.' does not ignore the root directory:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment