diff mbox series

[v3,8/9] test/py: allow multi-digit index in in_tree()

Message ID 20200924043418.5355-9-p.yadav@ti.com
State Accepted
Commit 8a34d3d75207565950c53ac3d68e144d099c9e5f
Delegated to: Tom Rini
Headers show
Series regmap: Add managed API, regmap fields, regmap config | expand

Commit Message

Pratyush Yadav Sept. 24, 2020, 4:34 a.m. UTC
When more nodes are added for a uclass the index might go into two or
more digits. This means that there are less spaces printed because they
are used up by the extra digits. Update the regular expression to allow
variable-length spacing between the class name and and index.

This was discovered when adding a simple_bus node in test.dts made
test_bind_unbind_with_uclass() fail because the index went up to 10.

Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
---

Notes:
    New in v3.

 test/py/tests/test_bind.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tom Rini Oct. 1, 2020, 2:09 p.m. UTC | #1
On Thu, Sep 24, 2020 at 10:04:17AM +0530, Pratyush Yadav wrote:

> When more nodes are added for a uclass the index might go into two or
> more digits. This means that there are less spaces printed because they
> are used up by the extra digits. Update the regular expression to allow
> variable-length spacing between the class name and and index.
> 
> This was discovered when adding a simple_bus node in test.dts made
> test_bind_unbind_with_uclass() fail because the index went up to 10.
> 
> Signed-off-by: Pratyush Yadav <p.yadav@ti.com>

Applied to u-boot/next, thanks!
diff mbox series

Patch

diff --git a/test/py/tests/test_bind.py b/test/py/tests/test_bind.py
index 5e73d40361..6703325c0b 100644
--- a/test/py/tests/test_bind.py
+++ b/test/py/tests/test_bind.py
@@ -16,7 +16,7 @@  def in_tree(response, name, uclass, drv, depth, last_child):
                         leaf = leaf + '`'
 
 	leaf = leaf + '-- ' + name
-	line = (r' *{:10.10}    [0-9]*  \[ [ +] \]   {:20.20}  [` |]{}$'
+	line = (r' *{:10.10} *[0-9]*  \[ [ +] \]   {:20.20}  [` |]{}$'
 	        .format(uclass, drv, leaf))
 	prog = re.compile(line)
 	for l in lines: