Add addl tests
This commit is contained in:
@@ -35,5 +35,31 @@ testProjectRoot002() {
|
||||
assertEquals "" "$pr"
|
||||
}
|
||||
|
||||
testResolveSymlink001() {
|
||||
d1=$(mktemp -d --tmpdir targetdir.XXXXX)
|
||||
expected="$d1/target"
|
||||
touch "$expected"
|
||||
|
||||
d2=$(mktemp -d --tmpdir linkdir.XXXXX)
|
||||
link="$d2"/link
|
||||
ln -s "$d1"/target "$link"
|
||||
|
||||
resolved=$(resolve_symlink $link)
|
||||
|
||||
assertEquals "$expected" "$resolved"
|
||||
}
|
||||
|
||||
# This test is ugly but there's no obvious way to make it
|
||||
# better without making it entirely tautological.
|
||||
testNoramlizeDirOfFile001() {
|
||||
input="$DIR"/../install.sh
|
||||
|
||||
expected="$DIR/.."
|
||||
|
||||
out=$(normalize_dir_of_file "$input")
|
||||
|
||||
assertEquals "$expected" "$out/tests/.."
|
||||
}
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
source shunit2
|
||||
|
||||
Reference in New Issue
Block a user