-
Notifications
You must be signed in to change notification settings - Fork 383
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(scp): Add unit tests for getting remote files
This tests the current behaviour of the xfunc_scp_compgen_remote_files function, including escaping, by introducing a fixture to mock ssh invocation on the local host.
- Loading branch information
Showing
2 changed files
with
62 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
set -eu | ||
args=("$@") | ||
while true; do | ||
arg="${args[0]-}" | ||
case "$arg" in | ||
-o) | ||
args=("${args[@]:2}") | ||
;; | ||
local) | ||
args=("${args[@]:1}") | ||
;; | ||
*) | ||
break | ||
;; | ||
esac | ||
done | ||
#shellcheck disable=SC2068 | ||
${args[@]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters