diff options
Diffstat (limited to '')
-rwxr-xr-x | test-files.sh | 2 | ||||
-rwxr-xr-x | test-status.sh | 31 |
2 files changed, 32 insertions, 1 deletions
diff --git a/test-files.sh b/test-files.sh index 2bfa944..97a017e 100755 --- a/test-files.sh +++ b/test-files.sh @@ -22,7 +22,7 @@ test_untracked_files() { assertEquals "" "$(untracked_status)" touch foo - assertEquals "1$untracked$added" "$(untracked_status)" + assertEquals "1A" "$(untracked_status)" git add . assertEquals "" "$(untracked_status)" 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 |