Commit graph

12 commits

Author SHA1 Message Date
Brian Gernhardt 4a45f7dd49 Use test_expect_success for test setups
Several tests did not use test_expect_success for their setup
commands.  Putting these start commands into the testing framework
means both that errors during setup will be caught quickly and that
non-error text will be suppressed without -v.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-20 09:15:17 -07:00
Nanako Shiraishi 0cb0e143ff tests: use "git xyzzy" form (t0000 - t3599)
Converts tests between t0050-t3903.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-03 12:41:46 -07:00
Jeff King 74f16b0c6f mask necessary whitespace policy violations in test scripts
All of these violations are necessary parts of the tests
(which are generally checking the behavior of trailing
whitespace, or contain diff fragments with empty lines).

Our solution is two-fold:

  1. Process input with whitespace problems using tr. This
     has the added bonus that it becomes very obvious where
     the bogus whitespace is intended to go.

  2. Move large diff fragments into their own supplemental
     files. This gets rid of the whitespace problem, since
     supplemental files are not checked, and it also makes
     the test script a bit easier to read.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-14 11:39:16 -07:00
Brandon Casey ba26ab99d4 mktag.c: tweak validation of tagger field and adjust test script
Update the verify_tag() function to remove an unnecessary test, and add
additional check for angle brackets in the name and email field, and
spaces in the email field. The timestamp and timezone sections are made
more straight forward by using strspn().

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-31 22:43:34 -07:00
Brandon Casey e0aaf781f6 mktag.c: improve verification of tagger field and tests
Since nearly its birth, git's tags have included a "tagger" field which
describes the name of tagger, email of tagger, and date and time of tagging.
But, this field was only loosely tested by git-mktag. Provide some thorough
testing for this field and also ensure that the tag header is separated
from the tag body by an empty line to reduce the convenience of creating
a flawed tag.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-30 22:54:09 -07:00
Brandon Casey 525d461528 t/t3800-mktag.sh: use test_must_fail rather than '!'
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-26 14:26:52 -07:00
Junio C Hamano e9b20943b7 t/t3800: do not use a temporary file to hold expected result.
It is a good practice to write program output to a temporary file
during the test, as it would allow easier postmortem when the tested
program does break.  But there is no benefit in writing the expected
output out to the temporary.

This actually fixes a bug in check_verify_failure() routine.
The intention of the test seems to make sure the "git mktag" command
fails, and it spits out the expected error message.  But if the
command did not fail as expected, the shell function as originally
written would not have detected the failure.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-01-05 00:07:57 -08:00
Junio C Hamano 0feb4d1c99 t/t{3600,3800,5401}: do not use egrep when grep would do
There is nothing _wrong_ with egrep per se, but this way we
would have less dependency on external tools.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-01-05 00:07:57 -08:00
Junio C Hamano 5be60078c9 Rewrite "git-frotz" to "git frotz"
This uses the remove-dashes target to replace "git-frotz" to "git frotz".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-02 22:52:14 -07:00
Pavel Roskin 3dff5379bf Assorted typo fixes
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-03 21:49:54 -08:00
Jason Riedy 2aad957a51 Replace "echo -n" with printf in shell scripts.
Not all echos know -n.  This was causing a test failure in
t5401-update-hooks.sh, but not t3800-mktag.sh for some reason.

Signed-off-by: Jason Riedy <ejr@cs.berkeley.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-15 22:23:21 -08:00
Ramsay Allan Jones 446c6faec6 New tests and en-passant modifications to mktag.
These changes were originally part of the next patch, but have been
split out since they were peripheral to the main purpose of that patch.

  - update comment describing the signature format to reflect
    the current code.
  - remove trailing \n in calls to error(), since a \n is already
    provided by error().
  - remove redundant call to get_sha1_hex().
  - call sha1_to_hex(sha1) to convert to ascii, rather than attempting
    to print the raw sha1.

The new tests provide a regression suite to support the modifications
to git-mktag in this and the next patch.

Signed-off-by: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-02 00:27:18 -07:00