Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHG296648321710: tests: don't reimplement enumerate() in run-tests
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
( )
| hg-reviewers |
| Lint Skipped |
| Unit Tests Skipped |
| Path | Packages | |||
|---|---|---|---|---|
| M | tests/run-tests.py (6 lines) |
| Commit | Parents | Author | Summary | Date |
|---|---|---|---|---|
| Martin von Zweigbergk | Jul 2 2018, 3:02 AM |
| Status | Author | Revision | |
|---|---|---|---|
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz |
| if not lout.endswith(b'\n'): | if not lout.endswith(b'\n'): | ||||
| lout += b' (no-eol)\n' | lout += b' (no-eol)\n' | ||||
| # Find the expected output at the current position. | # Find the expected output at the current position. | ||||
| els = [None] | els = [None] | ||||
| if expected.get(pos, None): | if expected.get(pos, None): | ||||
| els = expected[pos] | els = expected[pos] | ||||
| i = 0 | |||||
| optional = [] | optional = [] | ||||
| while i < len(els): | for i, el in enumerate(els): | ||||
| el = els[i] | |||||
| r = self.linematch(el, lout) | r = self.linematch(el, lout) | ||||
| if isinstance(r, str): | if isinstance(r, str): | ||||
| if r == '-glob': | if r == '-glob': | ||||
| lout = ''.join(el.rsplit(' (glob)', 1)) | lout = ''.join(el.rsplit(' (glob)', 1)) | ||||
| r = '' # Warn only this line. | r = '' # Warn only this line. | ||||
| elif r == "retry": | elif r == "retry": | ||||
| postout.append(b' ' + el) | postout.append(b' ' + el) | ||||
| m = optline.match(el) | m = optline.match(el) | ||||
| if m: | if m: | ||||
| conditions = [ | conditions = [ | ||||
| c for c in m.group(2).split(b' ')] | c for c in m.group(2).split(b' ')] | ||||
| if not self._iftest(conditions): | if not self._iftest(conditions): | ||||
| optional.append(i) | optional.append(i) | ||||
| i += 1 | |||||
| if r: | if r: | ||||
| if r == "retry": | if r == "retry": | ||||
| continue | continue | ||||
| # clean up any optional leftovers | # clean up any optional leftovers | ||||
| for i in optional: | for i in optional: | ||||
| postout.append(b' ' + els[i]) | postout.append(b' ' + els[i]) | ||||
| for i in reversed(optional): | for i in reversed(optional): | ||||
| del els[i] | del els[i] | ||||