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