test_fsh() should quote its arguments before passing them
to `eval` otherwise there are problems when the arguments
contain spaces.
For example when running the following program:
```
#!/bin/sh
. ./ipfs-test-lib.sh
die () {
printf >&2 "%s\n" "$@"
exit 1
}
DIR1="test dir 1"
DIR2="test dir 2"
mkdir "$DIR1" "$DIR2" || die "Could not mkdir '$DIR1' '$DIR2'"
echo "in dir 1" >"$DIR1/file1" || die "Could not write into '$DIR1/file1'"
echo "in dir 2" >"$DIR2/file2" || die "Could not write into '$DIR2/file2'"
if test_cmp "$DIR1/file1" "$DIR2/file2"
then
echo "test_cmp succeeded!"
else
echo "test_cmp failed!"
fi
rm -rf "$DIR1" "$DIR2" || die "Could not rm -rf '$DIR1' '$DIR2'"
```
we get:
```
> diff -u test dir 1/file1 test dir 2/file2
diff: extra operand '1/file1'
diff: Try 'diff --help' for more information.
test_cmp failed!
```
License: MIT
Signed-off-by:
Christian Couder <chriscool@tuxfamily.org>
| 名称 |
最后提交
|
最后更新 |
|---|---|---|
| .. | ||
| 3nodetest | 正在载入提交数据... | |
| api-startup | 正在载入提交数据... | |
| bench | 正在载入提交数据... | |
| bin | 正在载入提交数据... | |
| dependencies | 正在载入提交数据... | |
| integration | 正在载入提交数据... | |
| sharness | 正在载入提交数据... | |
| supernode_client | 正在载入提交数据... | |
| .gitignore | 正在载入提交数据... | |
| Makefile | 正在载入提交数据... | |
| README.md | 正在载入提交数据... | |
| ipfs-test-lib.sh | 正在载入提交数据... | |
| sharness_test_coverage_helper.sh | 正在载入提交数据... |