changeset 7296:695383442347

mq: put qnew tests into own file, fold in qnew-twice
author Brendan Cully <brendan@kublai.com>
date Thu, 30 Oct 2008 12:31:24 -0700
parents 66d0fc108044
children bd6deb7525f4
files tests/test-mq tests/test-mq-qnew tests/test-mq-qnew-twice tests/test-mq-qnew-twice.out tests/test-mq-qnew.out tests/test-mq.out
diffstat 6 files changed, 67 insertions(+), 61 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-mq	Wed Oct 29 18:54:46 2008 -0500
+++ b/tests/test-mq	Thu Oct 30 12:31:24 2008 -0700
@@ -42,17 +42,6 @@
 hg --cwd c qinit -c
 hg -R c/.hg/patches st
 
-echo % qnew should refuse bad patch names
-hg -R c qnew series
-hg -R c qnew status
-hg -R c qnew guards
-hg -R c qnew .hgignore
-
-echo % qnew implies add
-
-hg -R c qnew test.patch
-hg -R c/.hg/patches st
-
 echo '% qinit; qinit -c'
 hg init d
 cd d
@@ -90,25 +79,7 @@
 
 cd a
 
-echo a > somefile
-hg add somefile
-
-echo % qnew with uncommitted changes
-
-hg qnew uncommitted.patch
-hg st
-hg qseries
-
-echo '% qnew missing'
-hg qnew missing.patch missing
-
-hg revert --no-backup somefile
-rm somefile
-
-echo % qnew -m
-
 hg qnew -m 'foo bar' test.patch
-cat .hg/patches/test.patch
 
 echo % qrefresh
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-qnew	Thu Oct 30 12:31:24 2008 -0700
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+echo "[extensions]" >> $HGRCPATH
+echo "mq=" >> $HGRCPATH
+
+hg init mq
+cd mq
+
+echo a > a
+hg ci -Ama
+
+echo '% qnew should refuse bad patch names'
+hg qnew series
+hg qnew status
+hg qnew guards
+hg qnew .hgignore
+
+hg qinit -c
+
+echo '% qnew with uncommitted changes'
+echo a > somefile
+hg add somefile
+hg qnew uncommitted.patch
+hg st
+hg qseries
+hg revert --no-backup somefile
+rm somefile
+
+echo '% qnew implies add'
+hg qnew test.patch
+hg -R .hg/patches st
+
+echo '% qnew missing'
+hg qnew missing.patch missing
+
+echo '% qnew -m'
+hg qnew -m 'foo bar' mtest.patch
+cat .hg/patches/mtest.patch
+
+echo '% qnew twice'
+hg qnew first.patch
+hg qnew first.patch
+
+touch ../first.patch
+hg qimport ../first.patch
+
+exit 0
--- a/tests/test-mq-qnew-twice	Wed Oct 29 18:54:46 2008 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-
-hg init a
-cd a
-hg qnew first.patch
-hg qnew first.patch
-
-touch ../first.patch
-hg qimport ../first.patch
-
-exit 0
--- a/tests/test-mq-qnew-twice.out	Wed Oct 29 18:54:46 2008 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-abort: patch "first.patch" already exists
-abort: patch "first.patch" already exists
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-qnew.out	Thu Oct 30 12:31:24 2008 -0700
@@ -0,0 +1,20 @@
+adding a
+% qnew should refuse bad patch names
+abort: "series" cannot be used as the name of a patch
+abort: "status" cannot be used as the name of a patch
+abort: "guards" cannot be used as the name of a patch
+abort: ".hgignore" cannot be used as the name of a patch
+% qnew with uncommitted changes
+abort: local changes found, refresh first
+A somefile
+% qnew implies add
+A .hgignore
+A series
+A test.patch
+% qnew missing
+abort: missing: No such file or directory
+% qnew -m
+foo bar
+% qnew twice
+abort: patch "first.patch" already exists
+abort: patch "first.patch" already exists
--- a/tests/test-mq.out	Wed Oct 29 18:54:46 2008 -0500
+++ b/tests/test-mq.out	Thu Oct 30 12:31:24 2008 -0700
@@ -65,15 +65,6 @@
 % qinit -c
 A .hgignore
 A series
-% qnew should refuse bad patch names
-abort: "series" cannot be used as the name of a patch
-abort: "status" cannot be used as the name of a patch
-abort: "guards" cannot be used as the name of a patch
-abort: ".hgignore" cannot be used as the name of a patch
-% qnew implies add
-A .hgignore
-A series
-A test.patch
 % qinit; qinit -c
   .hgignore:
 ^\.hg
@@ -96,13 +87,6 @@
   series:
 A
 B
-% qnew with uncommitted changes
-abort: local changes found, refresh first
-A somefile
-% qnew missing
-abort: missing: No such file or directory
-% qnew -m
-foo bar
 % qrefresh
 foo bar