Show More
@@ -1359,7 +1359,7 b' class TTest(Test):' | |||||
1359 | while i < len(els): |
|
1359 | while i < len(els): | |
1360 | el = els[i] |
|
1360 | el = els[i] | |
1361 |
|
1361 | |||
1362 |
r = |
|
1362 | r = self.linematch(el, lout) | |
1363 | if isinstance(r, str): |
|
1363 | if isinstance(r, str): | |
1364 | if r == '+glob': |
|
1364 | if r == '+glob': | |
1365 | lout = el[:-1] + ' (glob)\n' |
|
1365 | lout = el[:-1] + ' (glob)\n' | |
@@ -1385,9 +1385,7 b' class TTest(Test):' | |||||
1385 | if m: |
|
1385 | if m: | |
1386 | conditions = [c for c in m.group(2).split(' ')] |
|
1386 | conditions = [c for c in m.group(2).split(' ')] | |
1387 |
|
1387 | |||
1388 | if self._hghave(conditions)[0]: |
|
1388 | if not self._hghave(conditions)[0]: | |
1389 | lout = el |
|
|||
1390 | else: |
|
|||
1391 | optional.append(i) |
|
1389 | optional.append(i) | |
1392 |
|
1390 | |||
1393 | i += 1 |
|
1391 | i += 1 | |
@@ -1416,9 +1414,16 b' class TTest(Test):' | |||||
1416 | while expected.get(pos, None): |
|
1414 | while expected.get(pos, None): | |
1417 | el = expected[pos].pop(0) |
|
1415 | el = expected[pos].pop(0) | |
1418 | if el: |
|
1416 | if el: | |
1419 |
if |
|
1417 | if not el.endswith(b" (?)\n"): | |
1420 |
|
|
1418 | m = optline.match(el) | |
1421 |
|
|
1419 | if m: | |
|
1420 | conditions = [c for c in m.group(2).split(' ')] | |||
|
1421 | ||||
|
1422 | if self._hghave(conditions)[0]: | |||
|
1423 | # Don't append as optional line | |||
|
1424 | continue | |||
|
1425 | else: | |||
|
1426 | break | |||
1422 | postout.append(b' ' + el) |
|
1427 | postout.append(b' ' + el) | |
1423 |
|
1428 | |||
1424 | if lcmd: |
|
1429 | if lcmd: | |
@@ -1481,8 +1486,7 b' class TTest(Test):' | |||||
1481 | res += re.escape(c) |
|
1486 | res += re.escape(c) | |
1482 | return TTest.rematch(res, l) |
|
1487 | return TTest.rematch(res, l) | |
1483 |
|
1488 | |||
1484 | @staticmethod |
|
1489 | def linematch(self, el, l): | |
1485 | def linematch(el, l): |
|
|||
1486 | retry = False |
|
1490 | retry = False | |
1487 | if el == l: # perfect match (fast) |
|
1491 | if el == l: # perfect match (fast) | |
1488 | return True |
|
1492 | return True | |
@@ -1493,8 +1497,11 b' class TTest(Test):' | |||||
1493 | else: |
|
1497 | else: | |
1494 | m = optline.match(el) |
|
1498 | m = optline.match(el) | |
1495 | if m: |
|
1499 | if m: | |
|
1500 | conditions = [c for c in m.group(2).split(' ')] | |||
|
1501 | ||||
1496 | el = m.group(1) + b"\n" |
|
1502 | el = m.group(1) + b"\n" | |
1497 | retry = "retry" |
|
1503 | if not self._hghave(conditions)[0]: | |
|
1504 | retry = "retry" # Not required by listed features | |||
1498 |
|
1505 | |||
1499 | if el.endswith(b" (esc)\n"): |
|
1506 | if el.endswith(b" (esc)\n"): | |
1500 | if PYTHON3: |
|
1507 | if PYTHON3: |
@@ -624,7 +624,6 b' without client certificate:' | |||||
624 |
|
624 | |||
625 | $ P="$CERTSDIR" hg id https://localhost:$HGPORT/ |
|
625 | $ P="$CERTSDIR" hg id https://localhost:$HGPORT/ | |
626 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) |
|
626 | warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) | |
627 | (the full certificate chain may not be available locally; see "hg help debugssl") (windows !) |
|
|||
628 | abort: error: *handshake failure* (glob) |
|
627 | abort: error: *handshake failure* (glob) | |
629 | [255] |
|
628 | [255] | |
630 |
|
629 |
@@ -39,7 +39,8 b' def lm(expected, output):' | |||||
39 | and output.endswith(b'\n')), 'missing newline' |
|
39 | and output.endswith(b'\n')), 'missing newline' | |
40 | assert not re.search(br'[^ \w\\/\r\n()*?]', expected + output), \ |
|
40 | assert not re.search(br'[^ \w\\/\r\n()*?]', expected + output), \ | |
41 | b'single backslash or unknown char' |
|
41 | b'single backslash or unknown char' | |
42 | match = run_tests.TTest.linematch(expected, output) |
|
42 | test = run_tests.TTest('test-run-test.t', '.', '.') | |
|
43 | match = test.linematch(expected, output) | |||
43 | if isinstance(match, str): |
|
44 | if isinstance(match, str): | |
44 | return 'special: ' + match |
|
45 | return 'special: ' + match | |
45 | elif isinstance(match, bytes): |
|
46 | elif isinstance(match, bytes): |
@@ -158,6 +158,57 b' test diff colorisation' | |||||
158 | python hash seed: * (glob) |
|
158 | python hash seed: * (glob) | |
159 | #endif |
|
159 | #endif | |
160 |
|
160 | |||
|
161 | $ cat > test-failure.t << EOF | |||
|
162 | > $ true | |||
|
163 | > should go away (true !) | |||
|
164 | > $ true | |||
|
165 | > should stay (false !) | |||
|
166 | > | |||
|
167 | > Should remove first line, not second or third | |||
|
168 | > $ echo 'testing' | |||
|
169 | > baz*foo (glob) (true !) | |||
|
170 | > foobar*foo (glob) (false !) | |||
|
171 | > te*ting (glob) (true !) | |||
|
172 | > | |||
|
173 | > Should keep first two lines, remove third and last | |||
|
174 | > $ echo 'testing' | |||
|
175 | > test.ng (re) (true !) | |||
|
176 | > foo.ar (re) (false !) | |||
|
177 | > b.r (re) (true !) | |||
|
178 | > missing (?) | |||
|
179 | > awol (true !) | |||
|
180 | > EOF | |||
|
181 | $ rt test-failure.t | |||
|
182 | ||||
|
183 | --- $TESTTMP/test-failure.t | |||
|
184 | +++ $TESTTMP/test-failure.t.err | |||
|
185 | @@ -1,11 +1,9 @@ | |||
|
186 | $ true | |||
|
187 | - should go away (true !) | |||
|
188 | $ true | |||
|
189 | should stay (false !) | |||
|
190 | ||||
|
191 | Should remove first line, not second or third | |||
|
192 | $ echo 'testing' | |||
|
193 | - baz*foo (glob) (true !) | |||
|
194 | foobar*foo (glob) (false !) | |||
|
195 | te*ting (glob) (true !) | |||
|
196 | ||||
|
197 | @@ -13,6 +11,4 @@ | |||
|
198 | $ echo 'testing' | |||
|
199 | test.ng (re) (true !) | |||
|
200 | foo.ar (re) (false !) | |||
|
201 | - b.r (re) (true !) | |||
|
202 | missing (?) | |||
|
203 | - awol (true !) | |||
|
204 | ||||
|
205 | ERROR: test-failure.t output changed | |||
|
206 | ! | |||
|
207 | Failed test-failure.t: output changed | |||
|
208 | # Ran 1 tests, 0 skipped, 1 failed. | |||
|
209 | python hash seed: * (glob) | |||
|
210 | [1] | |||
|
211 | ||||
161 | basic failing test |
|
212 | basic failing test | |
162 | $ cat > test-failure.t << EOF |
|
213 | $ cat > test-failure.t << EOF | |
163 | > $ echo babar |
|
214 | > $ echo babar |
General Comments 0
You need to be logged in to leave comments.
Login now