Show More
@@ -1306,6 +1306,11 b' WARN_UNDEFINED = 1' | |||
|
1306 | 1306 | WARN_YES = 2 |
|
1307 | 1307 | WARN_NO = 3 |
|
1308 | 1308 | |
|
1309 | MARK_OPTIONAL = b" (?)\n" | |
|
1310 | ||
|
1311 | def isoptional(line): | |
|
1312 | return line.endswith(MARK_OPTIONAL) | |
|
1313 | ||
|
1309 | 1314 | class TTest(Test): |
|
1310 | 1315 | """A "t test" is a test backed by a .t file.""" |
|
1311 | 1316 | |
@@ -1660,7 +1665,7 b' class TTest(Test):' | |||
|
1660 | 1665 | els.pop(i) |
|
1661 | 1666 | break |
|
1662 | 1667 | if el: |
|
1663 |
if el |
|
|
1668 | if isoptional(el): | |
|
1664 | 1669 | optional.append(i) |
|
1665 | 1670 | else: |
|
1666 | 1671 | m = optline.match(el) |
@@ -1700,7 +1705,7 b' class TTest(Test):' | |||
|
1700 | 1705 | while expected.get(pos, None): |
|
1701 | 1706 | el = expected[pos].pop(0) |
|
1702 | 1707 | if el: |
|
1703 |
if not el |
|
|
1708 | if not isoptional(el): | |
|
1704 | 1709 | m = optline.match(el) |
|
1705 | 1710 | if m: |
|
1706 | 1711 | conditions = [c for c in m.group(2).split(b' ')] |
@@ -1773,9 +1778,9 b' class TTest(Test):' | |||
|
1773 | 1778 | if el == l: # perfect match (fast) |
|
1774 | 1779 | return True, True |
|
1775 | 1780 | retry = False |
|
1776 | if el.endswith(b" (?)\n"): | |
|
1781 | if isoptional(el): | |
|
1777 | 1782 | retry = "retry" |
|
1778 |
el = el[:- |
|
|
1783 | el = el[:-len(MARK_OPTIONAL)] + b"\n" | |
|
1779 | 1784 | else: |
|
1780 | 1785 | m = optline.match(el) |
|
1781 | 1786 | if m: |
General Comments 0
You need to be logged in to leave comments.
Login now