summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2016-01-27 23:57:47 -0700
committerSimon Glass <sjg@chromium.org>2016-01-28 21:01:24 -0700
commit44ac762b1437b274daf9e6f2dc924088b6332a54 (patch)
tree5de58786da78fb6f777e6c3f83dc2621da70dde4
parent26e1beccbeb82ce7a4713ad899eb34b795228891 (diff)
downloadu-boot-imx-44ac762b1437b274daf9e6f2dc924088b6332a54.zip
u-boot-imx-44ac762b1437b274daf9e6f2dc924088b6332a54.tar.gz
u-boot-imx-44ac762b1437b274daf9e6f2dc924088b6332a54.tar.bz2
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>
-rw-r--r--test/py/u_boot_spawn.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/py/u_boot_spawn.py b/test/py/u_boot_spawn.py
index d508075..7451455 100644
--- a/test/py/u_boot_spawn.py
+++ b/test/py/u_boot_spawn.py
@@ -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