diff options
Diffstat (limited to 'test-status.sh')
-rwxr-xr-x | test-status.sh | 42 |
1 files changed, 9 insertions, 33 deletions
diff --git a/test-status.sh b/test-status.sh index 025fc69..8b9cf2f 100755 --- a/test-status.sh +++ b/test-status.sh @@ -2,30 +2,6 @@ scriptDir="$(cd "$(dirname "$0")"; pwd)" source "$scriptDir/git-base.sh" -# X Y Meaning -# ------------------------------------------------- -# [MD] not updated -# M [ MD] updated in index -# A [ MD] added to index -# D [ M] deleted from index -# R [ MD] renamed in index -# C [ MD] copied in index -# [MARC] index and work tree matches -# [ MARC] M work tree changed since index -# [ MARC] D deleted in work tree -# ------------------------------------------------- -# D D unmerged, both deleted -# A U unmerged, added by us -# U D unmerged, deleted by them -# U A unmerged, added by them -# D U unmerged, deleted by us -# A A unmerged, both added -# U U unmerged, both modified -# ------------------------------------------------- -# ? ? untracked -# ! ! ignored -# ------------------------------------------------- - test_basic_unstaged_options() { status=""" M modified-and-unstaged @@ -41,7 +17,7 @@ test_basic_unstaged_options() { assertEquals "line:${LINENO} staged status failed match" "" "$(staged_status "$status")" assertEquals "line:${LINENO} untracked status failed match" "" "$(untracked_status "$status")" assertEquals "line:${LINENO} unstaged status failed match"\ - "1${unstaged}${deleted}1${unstaged}${modified}" "$(unstaged_status "$status")" + "1D1M" "$(unstaged_status "$status")" assertEquals "line:${LINENO} conflicted status failed match" "" "$(conflicted_status "$status")" } @@ -50,7 +26,7 @@ test_basic_staged_options() { A added-and-staged """ assertEquals "line:${LINENO} staged status failed match"\ - "1${staged}${added}" "$(staged_status "$status")" + "1A" "$(staged_status "$status")" assertEquals "line:${LINENO} untracked status failed match" "" "$(untracked_status "$status")" assertEquals "line:${LINENO} unstaged status failed match" "" "$(unstaged_status "$status")" assertEquals "line:${LINENO} conflicted status failed match" "" "$(conflicted_status "$status")" @@ -59,7 +35,7 @@ A added-and-staged M modified-and-staged """ assertEquals "line:${LINENO} staged status failed match"\ - "1${staged}${modified}" "$(staged_status "$status")" + "1M" "$(staged_status "$status")" assertEquals "line:${LINENO} untracked status failed match" "" "$(untracked_status "$status")" assertEquals "line:${LINENO} unstaged status failed match" "" "$(unstaged_status "$status")" assertEquals "line:${LINENO} conflicted status failed match" "" "$(conflicted_status "$status")" @@ -68,7 +44,7 @@ M modified-and-staged D deleted-and-staged """ assertEquals "line:${LINENO} staged status failed match"\ - "1${staged}${deleted}" "$(staged_status "$status")" + "1D" "$(staged_status "$status")" assertEquals "line:${LINENO} untracked status failed match" "" "$(untracked_status "$status")" assertEquals "line:${LINENO} unstaged status failed match" "" "$(unstaged_status "$status")" assertEquals "line:${LINENO} conflicted status failed match" "" "$(conflicted_status "$status")" @@ -77,7 +53,7 @@ D deleted-and-staged C copied-and-staged """ assertEquals "line:${LINENO} staged status failed match"\ - "1${staged}${copied}" "$(staged_status "$status")" + "1C" "$(staged_status "$status")" assertEquals "line:${LINENO} untracked status failed match" "" "$(untracked_status "$status")" assertEquals "line:${LINENO} unstaged status failed match" "" "$(unstaged_status "$status")" assertEquals "line:${LINENO} conflicted status failed match" "" "$(conflicted_status "$status")" @@ -86,7 +62,7 @@ C copied-and-staged R renamed-and-staged """ assertEquals "line:${LINENO} staged status failed match"\ - "1${staged}${renamed}" "$(staged_status "$status")" + "1R" "$(staged_status "$status")" assertEquals "line:${LINENO} untracked status failed match" "" "$(untracked_status "$status")" assertEquals "line:${LINENO} unstaged status failed match" "" "$(unstaged_status "$status")" assertEquals "line:${LINENO} conflicted status failed match" "" "$(conflicted_status "$status")" @@ -111,7 +87,7 @@ UA unmerged-added-by-them assertEquals "line:${LINENO}" "" "$(staged_status "$status")" assertEquals "line:${LINENO}" "" "$(untracked_status "$status")" assertEquals "line:${LINENO}" "" "$(unstaged_status "$status")" - assertEquals "line:${LINENO}" "2${conflicted}${them}" "$(conflicted_status "$status")" + assertEquals "line:${LINENO}" "2T" "$(conflicted_status "$status")" status=""" AU unmerged-added-by-us @@ -120,7 +96,7 @@ DU unmerged-deleted-by-us assertEquals "line:${LINENO}" "" "$(staged_status "$status")" assertEquals "line:${LINENO}" "" "$(untracked_status "$status")" assertEquals "line:${LINENO}" "" "$(unstaged_status "$status")" - assertEquals "line:${LINENO}" "2${conflicted}${us}" "$(conflicted_status "$status")" + assertEquals "line:${LINENO}" "2U" "$(conflicted_status "$status")" status=""" AA unmerged-both-added @@ -130,7 +106,7 @@ UU unmerged-both-modified assertEquals "line:${LINENO}" "" "$(staged_status "$status")" assertEquals "line:${LINENO}" "" "$(untracked_status "$status")" assertEquals "line:${LINENO}" "" "$(unstaged_status "$status")" - assertEquals "line:${LINENO}" "3${conflicted}${both}" "$(conflicted_status "$status")" + assertEquals "line:${LINENO}" "3B" "$(conflicted_status "$status")" } . ./shunit/shunit2 |