mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-11-28 05:00:26 +08:00
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>
18 lines
426 B
Bash
Executable file
18 lines
426 B
Bash
Executable file
# copy a file with contents
|
|
# ensure the contents are the same
|
|
set -e
|
|
cd "$HOME/testcp"
|
|
touch foo.txt
|
|
echo "The quick brown fox jumps over the lazy dog" > foo.txt
|
|
|
|
wsh file copy foo.txt bar.txt
|
|
|
|
|
|
FOO_MD5=$(md5sum foo.txt | cut -d " " -f1)
|
|
BAR_MD5=$(md5sum bar.txt | cut -d " " -f1)
|
|
if [ $FOO_MD5 != $BAR_MD5 ]; then
|
|
echo "files are not the same"
|
|
echo "FOO_MD5 is $FOO_MD5"
|
|
echo "BAR_MD5 is $BAR_MD5"
|
|
exit 1
|
|
fi
|