From: Philippe Proulx Date: Fri, 10 Nov 2023 04:16:22 +0000 (-0500) Subject: tests/utils/utils.sh: bt_grep_ok(): use `local -r` when possible X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=6184c5f5c234813416936651695b16f055b99e1b tests/utils/utils.sh: bt_grep_ok(): use `local -r` when possible Signed-off-by: Philippe Proulx Change-Id: Ifbe0ccbd2c42d929331eb87e5f7743083d9c1a1a --- diff --git a/tests/utils/utils.sh b/tests/utils/utils.sh index 9291db88..393cf163 100644 --- a/tests/utils/utils.sh +++ b/tests/utils/utils.sh @@ -359,13 +359,13 @@ bt_grep() { # ok() with the test name `$3` on the result of bt_grep() matching the # pattern `$1` within the file `$2`. bt_grep_ok() { - local pattern=$1 - local file=$2 - local test_name=$3 + local -r pattern=$1 + local -r file=$2 + local -r test_name=$3 bt_grep --silent "$pattern" "$file" - local ret=$? + local -r ret=$? if ! ok $ret "$test_name"; then {