[PATCH] tests: unify test-username-newline

Adrian Buehlmann adrian at cadifra.com
Tue Sep 14 09:56:41 CDT 2010


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1284475952 -7200
# Node ID bae5ccb0d26650e2c3d9f4ea51197b86cad1b62e
# Parent  4ec6616f075d30b83ffc626ea132513d8f46830c
tests: unify test-username-newline

diff --git a/tests/test-username-newline.out b/tests/test-username-newline.out
deleted file mode 100644
--- a/tests/test-username-newline.out
+++ /dev/null
@@ -1,8 +0,0 @@
-adding a
-abort: username 'foo\nbar1' contains a newline
-
-abort: username 'foo\nbar2' contains a newline
-
-transaction abort!
-rollback completed
-abort: username 'foo\nbar3' contains a newline!
diff --git a/tests/test-username-newline b/tests/test-username-newline.t
old mode 100755
new mode 100644
rename from tests/test-username-newline
rename to tests/test-username-newline.t
--- a/tests/test-username-newline
+++ b/tests/test-username-newline.t
@@ -1,22 +1,24 @@
-#!/bin/sh
-#
+  $ hg init
+  $ touch a
 
-hg init foo
-cd foo
-touch a
+  $ unset HGUSER
+  $ echo "[ui]" >> .hg/hgrc
+  $ echo "username= foo" >> .hg/hgrc
+  $ echo "          bar1" >> .hg/hgrc
 
+  $ hg ci -Am m
+  adding a
+  abort: username 'foo\nbar1' contains a newline
+  
+  $ rm .hg/hgrc
 
-unset HGUSER
-echo "[ui]" >> .hg/hgrc
-echo "username= foo" >> .hg/hgrc
-echo "          bar1" >> .hg/hgrc
+  $ HGUSER=`(echo foo; echo bar2)` hg ci -Am m
+  abort: username 'foo\nbar2' contains a newline
+  
+  $ hg ci -Am m -u "`(echo foo; echo bar3)`"
+  transaction abort!
+  rollback completed
+  abort: username 'foo\nbar3' contains a newline!
 
-hg ci -Am m
+  $ true
 
-rm .hg/hgrc
-
-HGUSER=`(echo foo; echo bar2)` hg ci -Am m
-
-hg ci -Am m -u "`(echo foo; echo bar3)`"
-
-true


More information about the Mercurial-devel mailing list