Add addl tests

This commit is contained in:
Michael Wolf
2023-09-30 14:23:34 -06:00
parent c59808ecc1
commit 7ed9ffce4a

View File

@@ -35,5 +35,31 @@ testProjectRoot002() {
assertEquals "" "$pr" 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 # shellcheck disable=SC1091
source shunit2 source shunit2