[PATCH] tests: unify test-issue322

Adrian Buehlmann adrian at cadifra.com
Fri Sep 3 16:39:33 CDT 2010


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1283549677 -7200
# Node ID 59b6ec78eac1d72152ba969be2ad83e90924e63b
# Parent  ed47fae3c551ff38aa771fc7ec1d44461ee35de3
tests: unify test-issue322

diff --git a/tests/test-issue322.out b/tests/test-issue322.out
deleted file mode 100644
--- a/tests/test-issue322.out
+++ /dev/null
@@ -1,12 +0,0 @@
-% file replaced with directory
-adding a
-% should fail - would corrupt dirstate
-abort: file 'a' in dirstate clashes with 'a/a'
-% directory replaced with file
-adding a/a
-% should fail - would corrupt dirstate
-abort: directory 'a' already in dirstate
-% directory replaced with file
-adding b/c/d
-% should fail - would corrupt dirstate
-abort: directory 'b' already in dirstate
diff --git a/tests/test-issue322 b/tests/test-issue322.t
old mode 100755
new mode 100644
rename from tests/test-issue322
rename to tests/test-issue322.t
--- a/tests/test-issue322
+++ b/tests/test-issue322.t
@@ -1,49 +1,58 @@
-#!/bin/sh
 # http://mercurial.selenic.com/bts/issue322
 
-echo % file replaced with directory
+File replaced with directory:
 
-hg init a
-cd a
-echo a > a
-hg commit -Ama
-rm a
-mkdir a
-echo a > a/a
+  $ hg init a
+  $ cd a
+  $ echo a > a
+  $ hg commit -Ama
+  adding a
+  $ rm a
+  $ mkdir a
+  $ echo a > a/a
 
-echo % should fail - would corrupt dirstate
-hg add a/a
+Should fail - would corrupt dirstate:
 
-cd ..
+  $ hg add a/a
+  abort: file 'a' in dirstate clashes with 'a/a'
 
-echo % directory replaced with file
+  $ cd ..
 
-hg init c
-cd c
-mkdir a
-echo a > a/a
-hg commit -Ama
+Directory replaced with file:
 
-rm -r a
-echo a > a
+  $ hg init c
+  $ cd c
+  $ mkdir a
+  $ echo a > a/a
+  $ hg commit -Ama
+  adding a/a
 
-echo % should fail - would corrupt dirstate
-hg add a
+  $ rm -r a
+  $ echo a > a
 
-cd ..
+Should fail - would corrupt dirstate:
 
-echo % directory replaced with file
+  $ hg add a
+  abort: directory 'a' already in dirstate
 
-hg init d
-cd d
-mkdir b
-mkdir b/c
-echo a > b/c/d
-hg commit -Ama
-rm -r b
-echo a > b
+  $ cd ..
 
-echo % should fail - would corrupt dirstate
-hg add b
+Directory replaced with file:
 
-exit 0
+  $ hg init d
+  $ cd d
+  $ mkdir b
+  $ mkdir b/c
+  $ echo a > b/c/d
+  $ hg commit -Ama
+  adding b/c/d
+  $ rm -r b
+  $ echo a > b
+
+Should fail - would corrupt dirstate:
+
+  $ hg add b
+  abort: directory 'b' already in dirstate
+
+  $ exit 0
+


More information about the Mercurial-devel mailing list