From mboxrd@z Thu Jan 1 00:00:00 1970 From: Karl =?utf-8?q?Hasselstr=C3=B6m?= Subject: [StGit PATCH 1/2] Test for specific exit code Date: Tue, 08 Jul 2008 06:03:11 +0200 Message-ID: <20080708040311.23134.76097.stgit@yoghurt> References: <20080708035750.23134.75833.stgit@yoghurt> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: git@vger.kernel.org To: Catalin Marinas X-From: git-owner@vger.kernel.org Tue Jul 08 06:04:16 2008 Return-path: Envelope-to: gcvg-git-2@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1KG4R2-00030a-J7 for gcvg-git-2@gmane.org; Tue, 08 Jul 2008 06:04:13 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750782AbYGHEDR convert rfc822-to-quoted-printable (ORCPT ); Tue, 8 Jul 2008 00:03:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750748AbYGHEDR (ORCPT ); Tue, 8 Jul 2008 00:03:17 -0400 Received: from diana.vm.bytemark.co.uk ([80.68.90.142]:4297 "EHLO diana.vm.bytemark.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750717AbYGHEDQ (ORCPT ); Tue, 8 Jul 2008 00:03:16 -0400 Received: from localhost ([127.0.0.1] helo=[127.0.1.1]) by diana.vm.bytemark.co.uk with esmtp (Exim 3.36 #1 (Debian)) id 1KG4Q2-0000Xz-00; Tue, 08 Jul 2008 05:03:10 +0100 In-Reply-To: <20080708035750.23134.75833.stgit@yoghurt> User-Agent: StGIT/0.14.3.185.gb9e85 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: When a command is supposed to fail in a test, test for the exact error code we're expecting, not just that it's non-zero. This makes sure e.g. that a command that's supposed to fail doesn't do so with an unhandled exception. Signed-off-by: Karl Hasselstr=C3=B6m --- t/README | 6 +++--- t/t0001-subdir-branches.sh | 12 ++++++------ t/t0002-status.sh | 2 +- t/t1000-branch-create.sh | 8 ++++---- t/t1001-branch-rename.sh | 2 +- t/t1002-branch-clone.sh | 2 +- t/t1200-push-modified.sh | 2 +- t/t1202-push-undo.sh | 4 ++-- t/t1203-push-conflict.sh | 4 ++-- t/t1205-push-subdir.sh | 4 ++-- t/t1301-repair.sh | 2 +- t/t1302-repair-interop.sh | 4 ++-- t/t1400-patch-history.sh | 2 +- t/t1501-sink.sh | 2 +- t/t1600-delete-one.sh | 4 ++-- t/t1601-delete-many.sh | 2 +- t/t2000-sync.sh | 4 ++-- t/t2101-pull-policy-pull.sh | 2 +- t/t2200-rebase.sh | 2 +- t/t2500-clean.sh | 2 +- t/t2900-rename.sh | 8 ++++---- t/t3000-dirty-merge.sh | 2 +- t/t4000-upgrade.sh | 2 +- t/test-lib.sh | 24 ++++++++++++++++++++++++ 24 files changed, 66 insertions(+), 42 deletions(-) diff --git a/t/README b/t/README index 77f0b6c..757f810 100644 --- a/t/README +++ b/t/README @@ -163,9 +163,9 @@ library for your script to use. yields success, test is considered a failure. =20 This should _not_ be used for tests that succeed when their - commands fail -- use test_expect_success and shell negation (!) for - that. test_expect_failure is for cases when a test is known to be - broken. + commands fail -- use test_expect_success and one of general_error, + command_error, and conflict for that. test_expect_failure is for + cases when a test is known to be broken. =20 - test_debug