test-lib-functions: drop redundant diagnostic print
commitcc8f95c04205b254154d89c17054aa963f31ad0b
authorMartin Ågren <martin.agren@gmail.com>
Mon, 31 Oct 2022 18:00:48 +0000 (31 19:00 +0100)
committerTaylor Blau <me@ttaylorr.com>
Tue, 1 Nov 2022 01:12:09 +0000 (31 21:12 -0400)
treedfb194aae2d7fabccf3ebc50527569df07b4571a
parentc03801e19cb8ab36e9c0d17ff3d5e0c3b0f24193
test-lib-functions: drop redundant diagnostic print

`test_path_is_missing` was introduced back in 2caf20c52b ("test-lib:
user-friendly alternatives to test [-d|-f|-e]", 2010-08-10). It took the
path that was supposed to be missing, as well as an optional "diagnosis"
that would be echoed if the path was found to be alive.

Commit 45a2686441 ("test-lib-functions: remove bug-inducing
"diagnostics" helper param", 2021-02-12) dropped this diagnostic
functionality from several `test_path_is_foo` helpers, but note how it
tweaked the README entry on `test_path_is_missing` without actually
adjusting its implementation.

Commit e7884b353b ("test-lib-functions: assert correct parameter count",
2021-02-12) then followed up by asserting that we get just a single
argument.

This history leaves us in a state where we assert that we have exactly
one argument, then go on to anyway check for arguments, echoing them
all. It's clear that we can simplify this code. We should also note that
we run `ls -ld "$1"`, so printing the filename a second time doesn't
really buy us anything. Thus, we can drop the whole `if` block as
redundant.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
t/test-lib-functions.sh