From d4f5fbdaf854575543f59cafa8e8b6c482c6e9d5 Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Sat, 30 Sep 2023 14:53:47 -0600 Subject: [PATCH] Add addl test --- tests/project-root1.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/project-root1.sh b/tests/project-root1.sh index 1d80071..c3c60e3 100755 --- a/tests/project-root1.sh +++ b/tests/project-root1.sh @@ -61,5 +61,18 @@ testNoramlizeDirOfFile001() { assertEquals "$expected" "$out/tests/.." } +testWfRoot() { + expected=$(normalize_dir_of_file "$DIR/../install.sh") + + dir=$(mktemp -d --tmpdir would-reformat-testProjectRoot001.XXXXXX) + cd "$dir" || exit + git init >/dev/null 2>&1 + "$DIR"/../install.sh 2>&2 >/dev/null + + got=$(wf_root $(pwd)) + + assertEquals "$expected" "$got" +} + # shellcheck disable=SC1091 source shunit2