From 4d05d3da717dc54c429f40703758640b1079ca22 Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Sat, 30 Sep 2023 17:19:47 -0600 Subject: [PATCH] Add addl wf_root test --- tests/project-root1.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/project-root1.sh b/tests/project-root1.sh index 449822f..52ead46 100755 --- a/tests/project-root1.sh +++ b/tests/project-root1.sh @@ -61,7 +61,7 @@ testNoramlizeDirOfFile001() { assertEquals "$expected" "$out/tests/.." } -testWfRoot() { +testWfRoot001() { expected=$(normalize_dir_of_file "$DIR/../install.sh") dir=$(mktemp -d --tmpdir would-reformat-testProjectRoot001.XXXXXX) @@ -69,7 +69,17 @@ testWfRoot() { git init >/dev/null 2>&1 "$DIR"/../install.sh 2>&2 >/dev/null - got=$(wf_root "$(pwd)") + got=$(wf_root) + + assertEquals "$expected" "$got" +} + +testWfRoot002() { + expected=$(normalize_dir_of_file "$DIR/../install.sh") + + export WF_ROOT="$expected" + + got=$(wf_root) assertEquals "$expected" "$got" }