Re: [PATCH 3/6] Test file for git-remote-mediawiki clone
Simon Cathebras <simon.cathebras@ensimag.imag.fr> a écrit :
Show 56 quoted lines
> From: Guillaume Sasdy <guillaume.sasdy@ensimag.imag.fr>
>
> This patch provides some tests for the clone in use by
> git-remote-mediawiki.
>
> Signed-off-by: Simon Cathebras <simon.cathebras@ensimag.imag.fr>
> Signed-off-by: Simon Perrat <simon.perrat@ensimag.imag.fr>
> Signed-off-by: Guillaume Sasdy <guillaume.sasdy@ensimag.imag.fr>
> Signed-off-by: Charles Roussel <charles.roussel@ensimag.imag.fr>
> Signed-off-by: Julien Khayat <julien.khayat@ensimag.imag.fr>
> Signed-off-by: Matthieu Moy <matthieu.moy@imag.fr>
> ---
> contrib/mw-to-git/t/t9360-mw-to-git-clone.sh | 238
> +++++++++++++++++++++++++++
> 1 file changed, 238 insertions(+)
> create mode 100755 contrib/mw-to-git/t/t9360-mw-to-git-clone.sh
>
> diff --git a/contrib/mw-to-git/t/t9360-mw-to-git-clone.sh
> b/contrib/mw-to-git/t/t9360-mw-to-git-clone.sh
> new file mode 100755
> index 0000000..07e1270
> --- /dev/null
> +++ b/contrib/mw-to-git/t/t9360-mw-to-git-clone.sh
> @@ -0,0 +1,238 @@
> +#!/bin/sh
> +#
> +# Copyright (C) 2012
> +# Charles Roussel <charles.roussel@ensimag.imag.fr>
> +# Simon Cathebras <simon.cathebras@ensimag.imag.fr>
> +# Julien Khayat <julien.khayat@ensimag.imag.fr>
> +# Guillaume Sasdy <guillaume.sasdy@ensimag.imag.fr>
> +# Simon Perrat <simon.perrat@ensimag.imag.fr>
> +#
> +# License: GPL v2 or later
> +
> +
> +test_description='Test the Git Mediawiki remote helper: git clone'
> +
> +. ./test-gitmw-lib.sh
> +. $TEST_DIRECTORY/test-lib.sh
> +
> +
> +test_check_precond
> +
> +
> +test_expect_success 'Git clone creates the git log expected with one file' '
> + wiki_reset &&
> + wiki_editpage foo "this is not important" false -c cat -s "this
> must be the same" &&
> + git clone mediawiki::http://'"$SERVER_ADDR:$PORT/$WIKI_DIR_NAME"'
> mw_dir_1 &&
> + (cd mw_dir_1 &&
> + git log --format=%s HEAD^..HEAD > log.tmp ) &&
> + echo "this must be the same" > msg.tmp &&
> + diff -b mw_dir_1/log.tmp msg.tmp
> +'
It's clearer to put it this way:
git clone [...] &&
(
cd ... &&
....
) &&
....And, about style:
"echo one >one" and not "echo one > one"