Add test whether linking actually links
This commit is contained in:
parent
e117fdaa70
commit
15fde99658
1 changed files with 34 additions and 3 deletions
|
@ -14,6 +14,17 @@ version = "0.1.0"
|
|||
EOS
|
||||
}
|
||||
|
||||
entry_linked_to() {
|
||||
cat <<EOS
|
||||
---
|
||||
[imag]
|
||||
links = [$1]
|
||||
version = "0.1.0"
|
||||
---
|
||||
|
||||
EOS
|
||||
}
|
||||
|
||||
mktestentry() {
|
||||
mkdir -p ${STORE}
|
||||
default_entry > ${STORE}/$1
|
||||
|
@ -23,7 +34,7 @@ test_link_modificates() {
|
|||
mktestentry "test~0.1.0"
|
||||
mktestentry "test2~0.1.0"
|
||||
|
||||
imag-link --from "test~0.1.0" --to "test2~0.1.0"
|
||||
imag-link internal add --from "test~0.1.0" --to "test2~0.1.0"
|
||||
|
||||
if [[ "$(default_entry)" -eq "$(cat_entry 'test~0.1.0')" ]] ||
|
||||
[[ "$(default_entry)" -eq "$(cat_entry 'test2~0.1.0')" ]]
|
||||
|
@ -33,6 +44,26 @@ test_link_modificates() {
|
|||
fi
|
||||
}
|
||||
|
||||
invoke_tests \
|
||||
test_link_modificates
|
||||
test_linking_links() {
|
||||
mktestentry "test~0.1.0"
|
||||
mktestentry "test2~0.1.0"
|
||||
|
||||
imag-link internal add --from "test~0.1.0" --to "test2~0.1.0"
|
||||
|
||||
if [[ "$(entry_linked_to '/test~0.1.0')" == "$(cat_entry 'test2~0.1.0')" ]];
|
||||
then
|
||||
err "Linking to 'test~0.1.0' didn't succeed for 'test2~0.1.0'"
|
||||
err $(cat_entry 'test2~0.1.0')
|
||||
fi
|
||||
|
||||
if [[ "$(entry_linked_to '/test2~0.1.0')" == "$(cat_entry 'test~0.1.0')" ]];
|
||||
then
|
||||
err "Linking to 'test2~0.1.0' didn't succeed for 'test~0.1.0'"
|
||||
err $(cat_entry 'test~0.1.0')
|
||||
fi
|
||||
}
|
||||
|
||||
invoke_tests \
|
||||
test_link_modificates \
|
||||
test_linking_links
|
||||
|
||||
|
|
Loading…
Reference in a new issue