mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-19 05:07:56 +00:00
Fix bugs in assertGrep and a rhizome test case
This commit is contained in:
parent
6988fb7dd9
commit
51b5cf8b54
@ -299,8 +299,7 @@ assertGrep() {
|
|||||||
_tfw_error "incorrect arguments"
|
_tfw_error "incorrect arguments"
|
||||||
return 254
|
return 254
|
||||||
fi
|
fi
|
||||||
_tfw_assert_grep "$1" "$1" "$2"
|
_tfw_assert_grep "$1" "$1" "$2" || _tfw_failexit
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Internal (private) functions that are not to be invoked directly from test
|
# Internal (private) functions that are not to be invoked directly from test
|
||||||
|
@ -40,7 +40,7 @@ setup_AddManifest() {
|
|||||||
setup_dna
|
setup_dna
|
||||||
assert_rhizome_list_empty
|
assert_rhizome_list_empty
|
||||||
echo "A test file" >file1
|
echo "A test file" >file1
|
||||||
echo >file1.manifest
|
echo 'name=wah' >file1.manifest
|
||||||
echo "Another test file" >file2
|
echo "Another test file" >file2
|
||||||
}
|
}
|
||||||
test_AddManifest() {
|
test_AddManifest() {
|
||||||
@ -49,13 +49,13 @@ test_AddManifest() {
|
|||||||
tfw_cat --stdout
|
tfw_cat --stdout
|
||||||
tfw_cat --stderr
|
tfw_cat --stderr
|
||||||
tfw_cat -v file1.manifest
|
tfw_cat -v file1.manifest
|
||||||
assertGrep file1.manifest '^name="file1"$'
|
assertGrep file1.manifest '^name=wah$'
|
||||||
assertGrep file1.manifest '^date=[0-9]\+$'
|
assertGrep file1.manifest '^date=[0-9]\+$'
|
||||||
assertGrep file1.manifest '^version=[0-9]\+$'
|
assertGrep file1.manifest '^version=[0-9]\+$'
|
||||||
assertGrep file1.manifest '^id=[0-9a-fA-F]\+$'
|
assertGrep file1.manifest '^id=[0-9a-fA-F]\+$'
|
||||||
assertGrep file1.manifest "^filesize=$(wc --bytes file1)\$"
|
assertGrep file1.manifest "^filesize=$(cat file1 | wc --bytes)\$"
|
||||||
assertGrep file1.manifest "^first_byte=0$"
|
assertGrep file1.manifest "^first_byte=0$"
|
||||||
assertGrep file1.manifest "^last_byte=$(wc --bytes file1)\$"
|
assertGrep file1.manifest "^last_byte=$(cat file1 | wc --bytes)\$"
|
||||||
}
|
}
|
||||||
|
|
||||||
doc_AddThenList="Rhizome list contains one file after one add"
|
doc_AddThenList="Rhizome list contains one file after one add"
|
||||||
|
Loading…
Reference in New Issue
Block a user