waveterm/tests/copytests/cases/test009.sh
Sylvie Crowe 9e79df0684
feat: add tests for local wsh file copy cmd (#1911)
This adds tests for the corner cases of the `wsh file copy` command. At
the moment, these focus on local copies since they are more easily
replicated.

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-02-06 15:28:26 -08:00

14 lines
312 B
Bash
Executable File

# copy a file to itself with the same literal name
# ensure the operation fails and the file still exists
set -e
cd "$HOME/testcp"
touch foo.txt
wsh file copy foo.txt foo.txt >/dev/null 2>&1 && echo "copy should have failed" && exit 1
if [ ! -f foo.txt ]; then
echo "foo.txt does not exist"
exit 1
fi