Skip to content

Commit

Permalink
stash: add test for the create command line arguments
Browse files Browse the repository at this point in the history
Currently there is no test showing the expected behaviour of git stash
create's command line arguments.  Add a test for that to show the
current expected behaviour and to make sure future refactorings don't
break those expectations.

Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
tgummerer authored and gitster committed Feb 20, 2017
1 parent f5727e2 commit 6f5ccd4
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions t/t3903-stash.sh
Expand Up @@ -784,4 +784,22 @@ test_expect_success 'push -m shows right message' '
test_cmp expect actual
'

test_expect_success 'create stores correct message' '
>foo &&
git add foo &&
STASH_ID=$(git stash create "create test message") &&
echo "On master: create test message" >expect &&
git show --pretty=%s -s ${STASH_ID} >actual &&
test_cmp expect actual
'

test_expect_success 'create with multiple arguments for the message' '
>foo &&
git add foo &&
STASH_ID=$(git stash create test untracked) &&
echo "On master: test untracked" >expect &&
git show --pretty=%s -s ${STASH_ID} >actual &&
test_cmp expect actual
'

test_done

0 comments on commit 6f5ccd4

Please sign in to comment.