test-hgignore.t: add tests for comments
Although support for comments in hgignore files has existed for a
while, it was previously untested.
--- a/tests/test-hgignore.t Wed Dec 09 05:56:54 2015 +0000
+++ b/tests/test-hgignore.t Thu Dec 10 21:32:19 2015 -0800
@@ -55,6 +55,23 @@
? a.c
? syntax
+Ensure that comments work:
+
+ $ touch 'foo#bar' 'quux#' 'baz\#wat'
+ $ cat <<'EOF' >> .hgignore
+ > # full-line comment
+ > # whitespace-only comment line
+ > syntax# pattern, no whitespace, then comment
+ > a.c # pattern, then whitespace, then comment
+ > baz\\# # escaped comment character
+ > foo\#b # escaped comment character
+ > quux\## escaped comment character at end of name
+ > EOF
+ $ hg status
+ A dir/b.o
+ ? .hgignore
+ $ rm 'foo#bar' 'quux#' 'baz\#wat'
+
Check it does not ignore the current directory '.':
$ echo "^\." > .hgignore