Show More
@@ -1160,6 +1160,7 b' class TTest(Test):' | |||||
1160 | els = expected[pos] |
|
1160 | els = expected[pos] | |
1161 |
|
1161 | |||
1162 | i = 0 |
|
1162 | i = 0 | |
|
1163 | optional = [] | |||
1163 | while i < len(els): |
|
1164 | while i < len(els): | |
1164 | el = els[i] |
|
1165 | el = els[i] | |
1165 |
|
1166 | |||
@@ -1181,11 +1182,18 b' class TTest(Test):' | |||||
1181 | if r: |
|
1182 | if r: | |
1182 | els.pop(i) |
|
1183 | els.pop(i) | |
1183 | break |
|
1184 | break | |
|
1185 | if el and el.endswith(b" (?)\n"): | |||
|
1186 | optional.append(i) | |||
1184 | i += 1 |
|
1187 | i += 1 | |
1185 |
|
1188 | |||
1186 | if r: |
|
1189 | if r: | |
1187 | if r == "retry": |
|
1190 | if r == "retry": | |
1188 | continue |
|
1191 | continue | |
|
1192 | # clean up any optional leftovers | |||
|
1193 | for i in optional: | |||
|
1194 | postout.append(b' ' + els[i]) | |||
|
1195 | for i in reversed(optional): | |||
|
1196 | del els[i] | |||
1189 | postout.append(b' ' + el) |
|
1197 | postout.append(b' ' + el) | |
1190 | else: |
|
1198 | else: | |
1191 | if self.NEEDESCAPE(lout): |
|
1199 | if self.NEEDESCAPE(lout): |
@@ -49,7 +49,7 b' a succesful test' | |||||
49 | > $ echo babar |
|
49 | > $ echo babar | |
50 | > babar |
|
50 | > babar | |
51 | > $ echo xyzzy |
|
51 | > $ echo xyzzy | |
52 |
> never |
|
52 | > never*happens (glob) (?) | |
53 | > xyzzy |
|
53 | > xyzzy | |
54 | > nor this (?) |
|
54 | > nor this (?) | |
55 | > $ printf 'abc\ndef\nxyz\n' |
|
55 | > $ printf 'abc\ndef\nxyz\n' |
General Comments 0
You need to be logged in to leave comments.
Login now