diff mbox series

[1/1] tst_test.sh: More readable syntax

Message ID 20200922144237.9865-1-pvorel@suse.cz
State Accepted
Headers show
Series [1/1] tst_test.sh: More readable syntax | expand

Commit Message

Petr Vorel Sept. 22, 2020, 2:42 p.m. UTC
"for cmd; do" works the same way as "for cmd in $*; do", but the latter
is more readable. Also sync the code with tst_require_cmds().

Fixes: dba1d50cb ("tst_test.sh: Add test cmd helper tst_check_cmds()")

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/lib/tst_test.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Li Wang Sept. 23, 2020, 6:45 a.m. UTC | #1
On Tue, Sep 22, 2020 at 10:42 PM Petr Vorel <pvorel@suse.cz> wrote:

> "for cmd; do" works the same way as "for cmd in $*; do", but the latter
> is more readable. Also sync the code with tst_require_cmds().
>
> Fixes: dba1d50cb ("tst_test.sh: Add test cmd helper tst_check_cmds()")
>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
>

Reviewed-by: Li Wang <liwang@redhat.com>
Petr Vorel Sept. 23, 2020, 9:10 a.m. UTC | #2
Hi Li,

> On Tue, Sep 22, 2020 at 10:42 PM Petr Vorel <pvorel@suse.cz> wrote:

> > "for cmd; do" works the same way as "for cmd in $*; do", but the latter
> > is more readable. Also sync the code with tst_require_cmds().

> > Fixes: dba1d50cb ("tst_test.sh: Add test cmd helper tst_check_cmds()")

> > Signed-off-by: Petr Vorel <pvorel@suse.cz>


> Reviewed-by: Li Wang <liwang@redhat.com>
Thanks for a review, merged.

Kind regards,
Petr
diff mbox series

Patch

diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
index fa97acbac..f2bd1e3ef 100644
--- a/testcases/lib/tst_test.sh
+++ b/testcases/lib/tst_test.sh
@@ -350,7 +350,7 @@  tst_require_cmds()
 tst_check_cmds()
 {
 	local cmd
-	for cmd; do
+	for cmd in $*; do
 		if ! tst_cmd_available $cmd; then
 			tst_res TCONF "'$cmd' not found"
 			return 1