From 0175c1c40f9567a401a986d85ab6d6f5365eec7a Mon Sep 17 00:00:00 2001 From: Malfurious Date: Mon, 23 Aug 2021 07:35:24 -0400 Subject: Remove unit tests I don't particularly wish to maintain these tests for a few reasons: * Many of them make assertions strictly about rendered text / UI * Many of them test external systems and touch the disk * There are platform-dependent details that complicate several tests. So, the tests are removed. Ideally, the main script is reworked into something simple enough it doesn't necessarily warrant heavy testing. Signed-off-by: Malfurious --- test/test-stash.sh | 50 -------------------------------------------------- 1 file changed, 50 deletions(-) delete mode 100755 test/test-stash.sh (limited to 'test/test-stash.sh') diff --git a/test/test-stash.sh b/test/test-stash.sh deleted file mode 100755 index 862aef1..0000000 --- a/test/test-stash.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -scriptDir="$(cd "$(dirname "$0")"; pwd)" - -source "$scriptDir/sonar-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_unstashed_status() { - cd_to_tmp - git init --quiet - - assertEquals "0" "$(stashed_status)" - - rm_tmp -} - -test_stashed_status() { - cd_to_tmp - git init --quiet - - touch foo - git add --all - git commit -m "Initial commit" >/dev/null - echo "test">foo - git stash > /dev/null - assertEquals "1" "$(stashed_status)" - - echo "test2">foo - git stash > /dev/null - assertEquals "2" "$(stashed_status)" - - git stash drop > /dev/null - assertEquals "1" "$(stashed_status)" - - - rm_tmp -} - -. ./shunit/shunit2 -- cgit v1.2.3