Mercurial > hg
comparison tests/test-run-tests.t @ 35155:6d5718e39657
run-tests: make "| foo (re)" not match everything
We make "foo (re)" match the entire line by adding a \Z to the regular
expression before matching. However, that doesn't help when the
regular expression is something like "| foo", because that gets
translated to "| foo\Z", where the "|" has lower precedence and it
thus matches the empty string, which is of course a prefix of every
string. Fix by wrapping expression in a group before adding the \Z to
the end.
Differential Revision: https://phab.mercurial-scm.org/D1546
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Wed, 29 Nov 2017 10:34:49 -0800 |
parents | fc0f3ed071fc |
children | b4b0aed7bfaf |
comparison
equal
deleted
inserted
replaced
35154:4c04fd032af6 | 35155:6d5718e39657 |
---|---|
96 failing test | 96 failing test |
97 ================== | 97 ================== |
98 | 98 |
99 test churn with globs | 99 test churn with globs |
100 $ cat > test-failure.t <<EOF | 100 $ cat > test-failure.t <<EOF |
101 > $ echo "bar-baz"; echo "bar-bad" | 101 > $ echo "bar-baz"; echo "bar-bad"; echo foo |
102 > bar*bad (glob) | 102 > bar*bad (glob) |
103 > bar*baz (glob) | 103 > bar*baz (glob) |
104 > | fo (re) | |
104 > EOF | 105 > EOF |
105 $ rt test-failure.t | 106 $ rt test-failure.t |
106 | 107 |
107 --- $TESTTMP/test-failure.t | 108 --- $TESTTMP/test-failure.t |
108 +++ $TESTTMP/test-failure.t.err | 109 +++ $TESTTMP/test-failure.t.err |
109 @@ -1,3 +1,3 @@ | 110 @@ -1,4 +1,4 @@ |
110 $ echo "bar-baz"; echo "bar-bad" | 111 $ echo "bar-baz"; echo "bar-bad"; echo foo |
111 + bar*baz (glob) | 112 + bar*baz (glob) |
112 bar*bad (glob) | 113 bar*bad (glob) |
113 - bar*baz (glob) | 114 - bar*baz (glob) |
115 - | fo (re) | |
116 + foo | |
114 | 117 |
115 ERROR: test-failure.t output changed | 118 ERROR: test-failure.t output changed |
116 ! | 119 ! |
117 Failed test-failure.t: output changed | 120 Failed test-failure.t: output changed |
118 # Ran 1 tests, 0 skipped, 1 failed. | 121 # Ran 1 tests, 0 skipped, 1 failed. |
124 #if no-windows pygments | 127 #if no-windows pygments |
125 $ rt test-failure.t --color always | 128 $ rt test-failure.t --color always |
126 | 129 |
127 \x1b[38;5;124m--- $TESTTMP/test-failure.t\x1b[39m (esc) | 130 \x1b[38;5;124m--- $TESTTMP/test-failure.t\x1b[39m (esc) |
128 \x1b[38;5;34m+++ $TESTTMP/test-failure.t.err\x1b[39m (esc) | 131 \x1b[38;5;34m+++ $TESTTMP/test-failure.t.err\x1b[39m (esc) |
129 \x1b[38;5;90;01m@@ -1,3 +1,3 @@\x1b[39;00m (esc) | 132 \x1b[38;5;90;01m@@ -1,4 +1,4 @@\x1b[39;00m (esc) |
130 $ echo "bar-baz"; echo "bar-bad" | 133 $ echo "bar-baz"; echo "bar-bad"; echo foo |
131 \x1b[38;5;34m+ bar*baz (glob)\x1b[39m (esc) | 134 \x1b[38;5;34m+ bar*baz (glob)\x1b[39m (esc) |
132 bar*bad (glob) | 135 bar*bad (glob) |
133 \x1b[38;5;124m- bar*baz (glob)\x1b[39m (esc) | 136 \x1b[38;5;124m- bar*baz (glob)\x1b[39m (esc) |
137 \x1b[38;5;124m- | fo (re)\x1b[39m (esc) | |
138 \x1b[38;5;34m+ foo\x1b[39m (esc) | |
134 | 139 |
135 \x1b[38;5;88mERROR: \x1b[39m\x1b[38;5;9mtest-failure.t\x1b[39m\x1b[38;5;88m output changed\x1b[39m (esc) | 140 \x1b[38;5;88mERROR: \x1b[39m\x1b[38;5;9mtest-failure.t\x1b[39m\x1b[38;5;88m output changed\x1b[39m (esc) |
136 ! | 141 ! |
137 \x1b[38;5;88mFailed \x1b[39m\x1b[38;5;9mtest-failure.t\x1b[39m\x1b[38;5;88m: output changed\x1b[39m (esc) | 142 \x1b[38;5;88mFailed \x1b[39m\x1b[38;5;9mtest-failure.t\x1b[39m\x1b[38;5;88m: output changed\x1b[39m (esc) |
138 # Ran 1 tests, 0 skipped, 1 failed. | 143 # Ran 1 tests, 0 skipped, 1 failed. |
143 [1] | 148 [1] |
144 $ cat tmp.log | 149 $ cat tmp.log |
145 | 150 |
146 --- $TESTTMP/test-failure.t | 151 --- $TESTTMP/test-failure.t |
147 +++ $TESTTMP/test-failure.t.err | 152 +++ $TESTTMP/test-failure.t.err |
148 @@ -1,3 +1,3 @@ | 153 @@ -1,4 +1,4 @@ |
149 $ echo "bar-baz"; echo "bar-bad" | 154 $ echo "bar-baz"; echo "bar-bad"; echo foo |
150 + bar*baz (glob) | 155 + bar*baz (glob) |
151 bar*bad (glob) | 156 bar*bad (glob) |
152 - bar*baz (glob) | 157 - bar*baz (glob) |
158 - | fo (re) | |
159 + foo | |
153 | 160 |
154 ERROR: test-failure.t output changed | 161 ERROR: test-failure.t output changed |
155 ! | 162 ! |
156 Failed test-failure.t: output changed | 163 Failed test-failure.t: output changed |
157 # Ran 1 tests, 0 skipped, 1 failed. | 164 # Ran 1 tests, 0 skipped, 1 failed. |