tests/cli/test-intersection.sh: rewrite test to avoid shellcheck warning master
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 3 Oct 2024 15:20:21 +0000 (11:20 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Fri, 4 Oct 2024 15:48:20 +0000 (11:48 -0400)
commitd0d7a6c0f585deb7e1a046309f58ac091a5a0789
treec77e8f964c5c5f5992515c4eebe161d817bdf0ec
parentf22091b4d139ffb1c3edc78ada72987364342b3f
tests/cli/test-intersection.sh: rewrite test to avoid shellcheck warning

Shellcheck 0.10.0 shows:

    $ shellcheck -x test-intersection.sh

    In test-intersection.sh line 36:
     ok $? "$totalevents events in the whole trace"
               ^-- SC2319 (warning): This $? refers to a condition, not a command. Assign to a variable to avoid it being overwritten.

    For more information:
      https://www.shellcheck.net/wiki/SC2319 -- This $? refers to a condition, no...

I think that Shellcheck is confused with what we're trying to do and
that the code is actually correct. Nevertheless, change the code to
circumvent this by using `is`, which looks nicer anyway.

This is not seen on the CI, since it currently runs Shellcheck 0.9.0.

Change-Id: I7bb861b478046ab327c5950c9deefa52953bc854
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/13316
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
tests/cli/test-intersection.sh
This page took 0.025131 seconds and 4 git commands to generate.