[PATCH/RFC v2 3/4] rev-parse: add tests for git rev-parse --flags.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Jon Seymour <jon.seymour@xxxxxxxxx>
---
 t/t1510-rev-parse-flags.sh |  116 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 116 insertions(+), 0 deletions(-)
 create mode 100755 t/t1510-rev-parse-flags.sh

diff --git a/t/t1510-rev-parse-flags.sh b/t/t1510-rev-parse-flags.sh
new file mode 100755
index 0000000..f41130d
--- /dev/null
+++ b/t/t1510-rev-parse-flags.sh
@@ -0,0 +1,116 @@
+#!/bin/sh
+#
+# Copyright (c) 2010 Jon Seymour
+#
+
+test_description='test git rev-parse --flags'
+. ./test-lib.sh
+
+test_commit "A"
+
+test_expect_success 'git rev-parse --flags -> ""' \
+'
+	output=$(git rev-parse --flags) &&
+	expected="" &&
+	test "${output}" = "${expected}"
+'
+
+test_expect_success 'git rev-parse --flags X -> ""' \
+'
+	output=$(git rev-parse --flags X) &&
+	expected="" &&
+	test "${output}" = "${expected}"
+'
+
+test_expect_success 'git rev-parse --no-revs --flags HEAD -> ""' \
+'
+	output=$(git rev-parse --no-revs --flags HEAD) &&
+	expected="" &&
+	test "${output}" = "${expected}"
+'
+
+test_expect_success 'git rev-parse --symbolic --flags HEAD -> "HEAD"' \
+'
+	output=$(git rev-parse --symbolic --flags HEAD) &&
+	expected="HEAD" &&
+	test "${output}" = "${expected}"
+'
+
+test_expect_success 'git rev-parse --flags -- -> ""' \
+'
+	output=$(git rev-parse --flags --) &&
+	expected="" &&
+	test "${output}" = "${expected}"
+'
+
+test_expect_success 'git rev-parse --flags -- X -> ""' \
+'
+	output=$(git rev-parse --flags -- X) &&
+	expected="" &&
+	test "${output}" = "${expected}"
+'
+
+test_expect_success 'git rev-parse --flags -- -X -> ""' \
+'
+	output=$(git rev-parse --flags -- -X) &&
+	expected="" &&
+	test "${output}" = "${expected}"
+'
+
+test_expect_success 'git rev-parse --flags -- -q --> ""' \
+'
+	output=$(git rev-parse --flags -- -q) &&
+	expected="" &&
+	test "${output}" = "${expected}"
+'
+
+test_expect_success 'git rev-parse --flags -X -> "-X"' \
+'
+	output="$(git rev-parse --flags -X)" &&
+	expected="-X" &&
+	test "${output}" = "${expected}"
+'
+
+test_expect_success 'git rev-parse --flags -q -> "-q"' \
+'
+	output=$(git rev-parse --flags -q) &&
+	expected="-q" &&
+	test "${output}" = "${expected}"
+'
+
+test_expect_success 'git rev-parse --flags -X -- Y -Z -> "-X"' \
+'
+	output=$(git rev-parse --flags -X -- Y -Z) &&
+	expected="-X" &&
+	test "${output}" = "${expected}"
+'
+
+test_expect_success 'git rev-parse --flags --no-flags -> "--no-flags"' \
+'
+	output=$(git rev-parse --flags --no-flags) &&
+	expected="--no-flags" &&
+	test "${output}" = "${expected}"
+'
+
+test_expect_success 'git rev-parse --no-flags --flags -X -> ""' \
+'
+	output=$(git rev-parse --no-flags --flags -X) &&
+	expected="" &&
+	test "${output}" = "${expected}"
+'
+
+test_expect_success 'git rev-parse --symbolic --no-flags --flags HEAD -> "HEAD"' \
+'
+	output=$(git rev-parse --symbolic --no-flags --flags HEAD) &&
+	expected="HEAD" &&
+	test "${output}" = "${expected}"
+'
+
+test_expect_success 'git rev-parse --no-flags --flags -X -> ""' \
+'
+	output=$(git rev-parse --no-flags --flags -X) &&
+	expected="" &&
+	test "${output}" = "${expected}"
+'
+
+test_done
-- 
1.7.3.1.gc81ce.dirty

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]