From f05711dbcf196f98f0e08d783f760d47d98b93a6 Mon Sep 17 00:00:00 2001 From: Michael Allen Date: Tue, 17 Feb 2015 17:09:45 +0000 Subject: untracked files reporting --- test-files.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 test-files.sh (limited to 'test-files.sh') diff --git a/test-files.sh b/test-files.sh new file mode 100755 index 0000000..ee583cc --- /dev/null +++ b/test-files.sh @@ -0,0 +1,33 @@ +scriptDir="$(cd "$(dirname "$0")"; pwd)" + +source "$scriptDir/git-base.sh" + +tmpfile="" + +cd_to_tmp() { + tmpfile="/tmp/git-prompt-tests-$(time_now)$1" + mkdir -p "$tmpfile" + cd "$tmpfile" +} + +rm_tmp() { + cd $scriptDir + rm -rf /tmp/git-prompt-tests* +} + +test_untracked_files() { + cd_to_tmp + git init --quiet + + assertEquals "0" "$(untracked_files)" + + touch foo + assertEquals "1" "$(untracked_files)" + + git add . + assertEquals "0" "$(untracked_files)" + + rm_tmp +} + +. ./shunit/shunit2 -- cgit v1.2.3