# HG changeset patch # User Nicolas Dumazet # Date 1281619199 -32400 # Node ID dedf7c811436bca0050dc243d97eb27318d58fd7 # Parent 88c3ff0512707df5e195316f25df4392a1f8e2e1 tests: unify test-committer diff -r 88c3ff051270 -r dedf7c811436 tests/test-committer --- a/tests/test-committer Thu Aug 12 22:14:19 2010 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -#!/bin/sh - -unset HGUSER -EMAIL="My Name " -export EMAIL - -hg init test -cd test -touch asdf -hg add asdf -hg commit -d '1000000 0' -m commit-1 -hg tip - -unset EMAIL -echo 1234 > asdf -hg commit -d '1000000 0' -u "foo@bar.com" -m commit-1 -hg tip -echo "[ui]" >> .hg/hgrc -echo "username = foobar " >> .hg/hgrc -echo 12 > asdf -hg commit -d '1000000 0' -m commit-1 -hg tip -echo 1 > asdf -hg commit -d '1000000 0' -u "foo@bar.com" -m commit-1 -hg tip -echo 123 > asdf -echo "[ui]" > .hg/hgrc -echo "username = " >> .hg/hgrc -hg commit -d '1000000 0' -m commit-1 -rm .hg/hgrc -hg commit -d '1000000 0' -m commit-1 2>&1 | sed -e "s/'[^']*'/user@host/" - -echo space > asdf -hg commit -d '1000000 0' -u ' ' -m commit-1 - -true diff -r 88c3ff051270 -r dedf7c811436 tests/test-committer.out --- a/tests/test-committer.out Thu Aug 12 22:14:19 2010 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -changeset: 0:9426b370c206 -tag: tip -user: My Name -date: Mon Jan 12 13:46:40 1970 +0000 -summary: commit-1 - -changeset: 1:4997f15a1b24 -tag: tip -user: foo@bar.com -date: Mon Jan 12 13:46:40 1970 +0000 -summary: commit-1 - -changeset: 2:72b8012b424e -tag: tip -user: foobar -date: Mon Jan 12 13:46:40 1970 +0000 -summary: commit-1 - -changeset: 3:35ff3067bedd -tag: tip -user: foo@bar.com -date: Mon Jan 12 13:46:40 1970 +0000 -summary: commit-1 - -abort: no username supplied (see "hg help config") -No username found, using user@host instead -transaction abort! -rollback completed -abort: empty username! diff -r 88c3ff051270 -r dedf7c811436 tests/test-committer.t --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-committer.t Thu Aug 12 22:19:59 2010 +0900 @@ -0,0 +1,63 @@ + $ unset HGUSER + $ EMAIL="My Name " + $ export EMAIL + + $ hg init test + $ cd test + $ touch asdf + $ hg add asdf + $ hg commit -d '1000000 0' -m commit-1 + $ hg tip + changeset: 0:9426b370c206 + tag: tip + user: My Name + date: Mon Jan 12 13:46:40 1970 +0000 + summary: commit-1 + + + $ unset EMAIL + $ echo 1234 > asdf + $ hg commit -d '1000000 0' -u "foo@bar.com" -m commit-1 + $ hg tip + changeset: 1:4997f15a1b24 + tag: tip + user: foo@bar.com + date: Mon Jan 12 13:46:40 1970 +0000 + summary: commit-1 + + $ echo "[ui]" >> .hg/hgrc + $ echo "username = foobar " >> .hg/hgrc + $ echo 12 > asdf + $ hg commit -d '1000000 0' -m commit-1 + $ hg tip + changeset: 2:72b8012b424e + tag: tip + user: foobar + date: Mon Jan 12 13:46:40 1970 +0000 + summary: commit-1 + + $ echo 1 > asdf + $ hg commit -d '1000000 0' -u "foo@bar.com" -m commit-1 + $ hg tip + changeset: 3:35ff3067bedd + tag: tip + user: foo@bar.com + date: Mon Jan 12 13:46:40 1970 +0000 + summary: commit-1 + + $ echo 123 > asdf + $ echo "[ui]" > .hg/hgrc + $ echo "username = " >> .hg/hgrc + $ hg commit -d '1000000 0' -m commit-1 + abort: no username supplied (see "hg help config") + $ rm .hg/hgrc + $ hg commit -d '1000000 0' -m commit-1 2>&1 + No username found, using '[^']*' instead + + $ echo space > asdf + $ hg commit -d '1000000 0' -u ' ' -m commit-1 + transaction abort! + rollback completed + abort: empty username! + + $ true