summaryrefslogtreecommitdiffstats
path: root/test-status.sh
diff options
context:
space:
mode:
authorMichael Allen <michael@michaelallen.io>2015-07-23 19:35:09 +0100
committerMichael Allen <michael@michaelallen.io>2015-07-23 19:35:09 +0100
commit5c31b9242140877bef777dd37f0810457bd9b64a (patch)
treeb1f29561e5b0dd7ea8a302fc21c1426c9de61543 /test-status.sh
parent292a040b4abbbf085b97f7b285e67c97960dc510 (diff)
downloadgit-sonar-5c31b9242140877bef777dd37f0810457bd9b64a.tar.gz
git-sonar-5c31b9242140877bef777dd37f0810457bd9b64a.zip
provide the ability to surround letter in a status with a color
Diffstat (limited to 'test-status.sh')
-rwxr-xr-xtest-status.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/test-status.sh b/test-status.sh
index 8b9cf2f..a831151 100755
--- a/test-status.sh
+++ b/test-status.sh
@@ -2,6 +2,37 @@ scriptDir="$(cd "$(dirname "$0")"; pwd)"
source "$scriptDir/git-base.sh"
+test_prefix_and_suffix() {
+ status="""
+ M unstaged-modified
+ D unstaged-deleted
+M staged-modified
+A staged-added
+D staged-deleted
+C staged-copied
+R staged-renamed
+UD deleted-them-conflicted
+AU added-us-conflicted
+UU modified-both-conflicted
+?? untacked
+"""
+
+ prefix="_"
+ suffix="-"
+
+ assertEquals "line:${LINENO}" "1_D-1_M-"\
+ "$(unstaged_status "$status" "$prefix" "$suffix")"
+
+ assertEquals "line:${LINENO}" "1_A-1_D-1_M-1_R-1_C-"\
+ "$(staged_status "$status" "$prefix" "$suffix")"
+
+ assertEquals "line:${LINENO}" "1_U-1_T-1_B-"\
+ "$(conflicted_status "$status" "$prefix" "$suffix")"
+
+ assertEquals "line:${LINENO}" "1_A-"\
+ "$(untracked_status "$status" "$prefix" "$suffix")"
+}
+
test_basic_unstaged_options() {
status="""
M modified-and-unstaged