@matheusbsbs / matheus-bagliano / commits / b683c08082
Fork 0

t3903-stash.sh: Add tests for new stash commands drop and pop

Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Brandon Casey committed Mar 2, 2008 at 14:58 UTC b683c08082d73484596dcf1236449228d4a9eb98
1 file changed +45 -1
t/t3903-stash.sh
+45 -1
@@ -70,7 +70,51 @@ test_expect_success 'unstashing in a subdirectory' '
70 git reset --hard HEAD &&
71 mkdir subdir &&
72 cd subdir &&
73 - git stash apply
73 + git stash apply &&
74 + cd ..
75 +'
76 +
77 +test_expect_success 'drop top stash' '
78 + git reset --hard &&
79 + git stash list > stashlist1 &&
80 + echo 7 > file &&
81 + git stash &&
82 + git stash drop &&
83 + git stash list > stashlist2 &&
84 + diff stashlist1 stashlist2 &&
85 + git stash apply &&
86 + test 3 = $(cat file) &&
87 + test 1 = $(git show :file) &&
88 + test 1 = $(git show HEAD:file)
89 +'
90 +
91 +test_expect_success 'drop middle stash' '
92 + git reset --hard &&
93 + echo 8 > file &&
94 + git stash &&
95 + echo 9 > file &&
96 + git stash &&
97 + git stash drop stash@{1} &&
98 + test 2 = $(git stash list | wc -l) &&
99 + git stash apply &&
100 + test 9 = $(cat file) &&
101 + test 1 = $(git show :file) &&
102 + test 1 = $(git show HEAD:file) &&
103 + git reset --hard &&
104 + git stash drop &&
105 + git stash apply &&
106 + test 3 = $(cat file) &&
107 + test 1 = $(git show :file) &&
108 + test 1 = $(git show HEAD:file)
109 +'
110 +
111 +test_expect_success 'stash pop' '
112 + git reset --hard &&
113 + git stash pop &&
114 + test 3 = $(cat file) &&
115 + test 1 = $(git show :file) &&
116 + test 1 = $(git show HEAD:file) &&
117 + test 0 = $(git stash list | wc -l)
118 '
119
120 test_done