From: Jeff Hostetler <jeffhost@microsoft.com>
To: git@vger.kernel.org
Cc: peff@peff.net, gitster@pobox.com, jeffhost@microsoft.com
Subject: [PATCH v1 2/6] Status and checkout unit tests for --porcelain[=<n>]
Date: Tue, 19 Jul 2016 18:10:54 -0400 [thread overview]
Message-ID: <1468966258-11191-3-git-send-email-jeffhost@microsoft.com> (raw)
In-Reply-To: <1468966258-11191-1-git-send-email-jeffhost@microsoft.com>
Simple unit tests to validate the argument parsing.
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
---
t/t7060-wtstatus.sh | 21 +++++++++++++++++++++
t/t7501-commit.sh | 14 ++++++++++++++
2 files changed, 35 insertions(+)
diff --git a/t/t7060-wtstatus.sh b/t/t7060-wtstatus.sh
index 44bf1d8..a39b0e2 100755
--- a/t/t7060-wtstatus.sh
+++ b/t/t7060-wtstatus.sh
@@ -228,4 +228,25 @@ test_expect_success 'status --branch with detached HEAD' '
test_i18ncmp expected actual
'
+## Duplicate the above test and verify --porcelain=1 has no effect.
+test_expect_success 'status --branch with detached HEAD' '
+ git reset --hard &&
+ git checkout master^0 &&
+ git status --branch --porcelain=1 >actual &&
+ cat >expected <<-EOF &&
+ ## HEAD (no branch)
+ ?? .gitconfig
+ ?? actual
+ ?? expect
+ ?? expected
+ ?? mdconflict/
+ EOF
+ test_i18ncmp expected actual
+'
+
+## Verify parser error on --porcelain argument.
+test_expect_failure 'status --porcelain=bogus' '
+ git status --porcelain=bogus
+'
+
test_done
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index d84897a..1a74d75 100755
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -73,6 +73,10 @@ test_expect_success '--porcelain fails with nothing to commit' '
test_must_fail git commit -m initial --porcelain
'
+test_expect_success '--porcelain=1 fails with nothing to commit' '
+ test_must_fail git commit -m initial --porcelain=1
+'
+
test_expect_success '--long fails with nothing to commit' '
test_must_fail git commit -m initial --long
'
@@ -97,6 +101,16 @@ test_expect_failure '--porcelain with stuff to commit returns ok' '
git commit -m next -a --porcelain
'
+test_expect_failure '--porcelain=1 with stuff to commit returns ok' '
+ echo bongo bongo bongo >>file &&
+ git commit -m next -a --porcelain=1
+'
+
+test_expect_failure '--porcelain=bogus with stuff to commit returns ok' '
+ echo bongo bongo bongo >>file &&
+ git commit -m next -a --porcelain=bogus
+'
+
test_expect_success '--long with stuff to commit returns ok' '
echo bongo bongo bongo >>file &&
git commit -m next -a --long
--
2.8.0.rc4.17.gac42084.dirty
next prev parent reply other threads:[~2016-07-19 22:13 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-19 22:10 [PATCH v1 0/6] Porcelain Status V2 Jeff Hostetler
2016-07-19 22:10 ` [PATCH v1 1/6] Allow --porcelain[=<n>] in status and commit commands Jeff Hostetler
2016-07-20 15:08 ` Johannes Schindelin
2016-07-20 15:38 ` Jeff Hostetler
2016-07-21 14:28 ` Johannes Schindelin
2016-07-20 15:58 ` Jeff King
2016-07-20 17:26 ` Jeff Hostetler
2016-07-20 20:46 ` Junio C Hamano
2016-07-19 22:10 ` Jeff Hostetler [this message]
2016-07-20 15:19 ` [PATCH v1 2/6] Status and checkout unit tests for --porcelain[=<n>] Johannes Schindelin
2016-07-20 15:51 ` Jeff Hostetler
2016-07-20 16:00 ` Jeff King
2016-07-20 16:03 ` Jeff King
2016-07-20 17:31 ` Jeff Hostetler
2016-07-20 17:29 ` Jeff Hostetler
2016-07-19 22:10 ` [PATCH v1 3/6] Per-file output for Porcelain Status V2 Jeff Hostetler
2016-07-20 20:50 ` Junio C Hamano
2016-07-21 14:19 ` Johannes Schindelin
2016-07-20 21:31 ` Junio C Hamano
2016-07-21 18:58 ` Jeff Hostetler
2016-07-22 17:01 ` Junio C Hamano
2016-07-19 22:10 ` [PATCH v1 4/6] Expanded branch header " Jeff Hostetler
2016-07-20 16:06 ` Jeff King
2016-07-20 18:20 ` Jeff Hostetler
2016-07-20 20:54 ` Jeff King
2016-07-21 15:46 ` Johannes Schindelin
2016-07-21 19:03 ` Jeff Hostetler
2016-07-19 22:10 ` [PATCH v1 5/6] Add porcelain V2 documentation to status manpage Jeff Hostetler
2016-07-20 15:29 ` Jakub Narębski
2016-07-20 15:42 ` Jeff Hostetler
2016-07-20 15:55 ` Jakub Narębski
2016-07-20 21:50 ` Junio C Hamano
2016-07-19 22:10 ` [PATCH v1 6/6] Unit tests for V2 porcelain status Jeff Hostetler
2016-07-20 15:30 ` Jakub Narębski
2016-07-20 15:47 ` Jeff Hostetler
2016-07-20 16:01 ` Jakub Narębski
2016-07-21 15:54 ` Johannes Schindelin
2016-07-20 16:15 ` [PATCH v1 0/6] Porcelain Status V2 Jeff King
2016-07-20 19:27 ` Jeff Hostetler
2016-07-20 20:57 ` Jeff King
2016-07-21 16:02 ` Johannes Schindelin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1468966258-11191-3-git-send-email-jeffhost@microsoft.com \
--to=jeffhost@microsoft.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.