[PATCH v2 02/10] hash-object tests: more detailed test for invalid type

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

 



Change the tests added in b7994af0f92 (type_from_string_gently: make
sure length matches, 2015-04-17) to check the return code and error
that's emitted.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx>
---
 t/t1007-hash-object.sh | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/t/t1007-hash-object.sh b/t/t1007-hash-object.sh
index 64b340f227..74486f6f1a 100755
--- a/t/t1007-hash-object.sh
+++ b/t/t1007-hash-object.sh
@@ -230,11 +230,19 @@ test_expect_success 'corrupt tag' '
 '
 
 test_expect_success 'hash-object complains about bogus type name' '
-	test_must_fail git hash-object -t bogus --stdin </dev/null
+	test_must_fail git hash-object -t bogus --stdin 2>actual </dev/null &&
+	cat >expect <<-\EOF &&
+	fatal: invalid object type "bogus"
+	EOF
+	test_cmp expect actual
 '
 
 test_expect_success 'hash-object complains about truncated type name' '
-	test_must_fail git hash-object -t bl --stdin </dev/null
+	test_must_fail git hash-object -t bl --stdin 2>actual </dev/null &&
+	cat >expect <<-\EOF &&
+	fatal: invalid object type "bl"
+	EOF
+	test_cmp expect actual
 '
 
 test_expect_success '--literally' '
-- 
2.31.1.723.ga5d7868e4a




[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]

  Powered by Linux