mirror of
https://github.com/u-boot/u-boot.git
synced 2024-12-02 00:53:29 +08:00
test/py: fix spawn.expect multiple match handling
Multiple patterns may be passed to spawn.expect(). The pattern which matches at the earliest position should be designated as the match. This aspect works correctly. When multiple patterns match at the same position, priority should be given the the earliest entry in the list of patterns. This aspect does not work correctly. This patch fixes it. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
26e1beccbe
commit
44ac762b14
@ -132,7 +132,7 @@ class Spawn(object):
|
||||
m = pattern.search(self.buf)
|
||||
if not m:
|
||||
continue
|
||||
if earliest_m and m.start() > earliest_m.start():
|
||||
if earliest_m and m.start() >= earliest_m.start():
|
||||
continue
|
||||
earliest_m = m
|
||||
earliest_pi = pi
|
||||
|
Loading…
Reference in New Issue
Block a user