comparison tests/test-hgignore.t @ 27326:ee2d7b5daa8a

test-hgignore.t: add tests for comments Although support for comments in hgignore files has existed for a while, it was previously untested.
author Bryan O'Sullivan <bos@serpentine.com>
date Thu, 10 Dec 2015 21:32:19 -0800
parents 3de48ff62733
children 988367ac2a2a
comparison
equal deleted inserted replaced
27325:eadbbd14bdc1 27326:ee2d7b5daa8a
53 A dir/b.o 53 A dir/b.o
54 ? .hgignore 54 ? .hgignore
55 ? a.c 55 ? a.c
56 ? syntax 56 ? syntax
57 57
58 Ensure that comments work:
59
60 $ touch 'foo#bar' 'quux#' 'baz\#wat'
61 $ cat <<'EOF' >> .hgignore
62 > # full-line comment
63 > # whitespace-only comment line
64 > syntax# pattern, no whitespace, then comment
65 > a.c # pattern, then whitespace, then comment
66 > baz\\# # escaped comment character
67 > foo\#b # escaped comment character
68 > quux\## escaped comment character at end of name
69 > EOF
70 $ hg status
71 A dir/b.o
72 ? .hgignore
73 $ rm 'foo#bar' 'quux#' 'baz\#wat'
74
58 Check it does not ignore the current directory '.': 75 Check it does not ignore the current directory '.':
59 76
60 $ echo "^\." > .hgignore 77 $ echo "^\." > .hgignore
61 $ hg status 78 $ hg status
62 A dir/b.o 79 A dir/b.o