diff --git a/README.md b/README.md
index a6391ad..114f357 100644
--- a/README.md
+++ b/README.md
@@ -113,6 +113,21 @@ script:
./tests/tests.sh
```
+# Lint
+
+To lint the shell scripts, you need to install `shellcheck` and `checkbashisms`. Those tools will check the scripts for issues and ensure they follow best practices.
+
+- On Debian-like systems: `apt install shellcheck devscripts`
+- On Fedora-like systems: `dnf install shellcheck devscripts`
+
+After installation, you can run `shellcheck` and `checkbashisms` by executing the following commands:
+
+```sh
+shellcheck wcurl ./tests/*
+
+checkbashisms wcurl ./tests/*
+```
+
# Authors
Samuel Henrique <[samueloph@debian.org](mailto:samueloph@debian.org)>
diff --git a/tests/tests.sh b/tests/tests.sh
index 0cf0356..ffc3082 100755
--- a/tests/tests.sh
+++ b/tests/tests.sh
@@ -26,7 +26,8 @@
#
# SPDX-License-Identifier: curl
-readonly ROOTDIR=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
+ROOTDIR=$(CDPATH=$(cd -- "$(dirname -- "$0")/.." && pwd))
+readonly ROOTDIR
export PATH="${ROOTDIR}:${PATH}"
readonly WCURL_CMD="wcurl --dry-run "
@@ -67,8 +68,9 @@ testParallelIfMoreThanOneUrl()
{
# TODO: This test is wrong for curl 7.65 or older, since --parallel was only introduced in 7.66.
# We should check curl's version and skip this test instead.
- urls='example.com/1 example.com/2'
- ret=$(${WCURL_CMD} ${urls})
+ url_1='example.com/1'
+ url_2='example.com/2'
+ ret=$(${WCURL_CMD} ${url_1} ${url_2})
assertContains "Verify whether 'wcurl' uses '--parallel' if more than one url is provided" "${ret}" '--parallel'
}
@@ -82,7 +84,7 @@ testEncodingWhitespace()
testDoubleDash()
{
params='example.com --curl-options=abc'
- ret=$(${WCURL_CMD} -- ${params})
+ ret=$(${WCURL_CMD} -- "${params}")
assertTrue "Verify whether 'wcurl' accepts '--' without erroring" "$?"
assertContains "Verify whether 'wcurl' considers everywhing after '--' a url" "${ret}" '--curl-options=abc'
}
@@ -90,7 +92,7 @@ testDoubleDash()
testCurlOptions()
{
params='example.com --curl-options=--foo --curl-options --bar'
- ret=$(${WCURL_CMD} ${params})
+ ret=$(${WCURL_CMD} "${params}")
assertTrue "Verify 'wcurl' accepts '--curl-options' with and without trailing '='" "$?"
assertContains "Verify 'wcurl' correctly passes through --curl-options=