All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Simon.Cathebras" <Simon.Cathebras@ensimag.imag.fr>
To: Simon Cathebras <simon.cathebras@ensimag.imag.fr>
Cc: git@vger.kernel.org, gitster@pobox.com, peff@peff.net,
	Simon Perrat <simon.perrat@ensimag.imag.fr>,
	Guillaume Sasdy <guillaume.sasdy@ensimag.imag.fr>,
	Charles Roussel <charles.roussel@ensimag.imag.fr>,
	Julien Khayat <julien.khayat@ensimag.imag.fr>,
	Matthieu Moy <matthieu.moy@imag.fr>
Subject: Re: [PATCH 5/6] Tests of UTF8 character with git-remote-mediawiki
Date: Tue, 12 Jun 2012 23:18:58 +0200	[thread overview]
Message-ID: <4FD7B242.9020005@ensimag.imag.fr> (raw)
In-Reply-To: <1339535563-18958-5-git-send-email-simon.cathebras@ensimag.imag.fr>

Please accept our appologize for the bad tag for patches.

The PATCH 5 is actually the last one...

Regards.

Simon C

On 12/06/2012 23:12, Simon Cathebras wrote:
> This patch provides a sample of tests for git-remote-mediawiki's
> resistance, concerning utf8 special characters.
>
> 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/t9362-mw-to-git-utf8.sh | 271 ++++++++++++++++++++++++++++
>   1 file changed, 271 insertions(+)
>   create mode 100755 contrib/mw-to-git/t/t9362-mw-to-git-utf8.sh
>
> diff --git a/contrib/mw-to-git/t/t9362-mw-to-git-utf8.sh b/contrib/mw-to-git/t/t9362-mw-to-git-utf8.sh
> new file mode 100755
> index 0000000..9227c6f
> --- /dev/null
> +++ b/contrib/mw-to-git/t/t9362-mw-to-git-utf8.sh
> @@ -0,0 +1,271 @@
> +#!/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
> +
> +# tests for git-remote-mediawiki
> +
> +test_description='Test git-mediawiki with special characters in filenames'
> +
> +. ./test-gitmw-lib.sh
> +. $TEST_DIRECTORY/test-lib.sh
> +
> +
> +test_check_precond
> +
> +
> +test_expect_success 'Git clone works for a wiki with accents in the page names' '
> +	wiki_reset&&
> +	wiki_editpage féé "This page must be délétéd before clone" false&&
> +	wiki_editpage kèè "This page must be deleted before clone" false&&
> +	wiki_editpage hàà "This page must be deleted before clone" false&&
> +	wiki_editpage kîî "This page must be deleted before clone" false&&
> +	wiki_editpage foo "This page must be deleted before clone" false&&
> +	git clone mediawiki::http://'"$SERVER_ADDR:$PORT/$WIKI_DIR_NAME"' mw_dir_1&&
> +	wiki_getallpage ref_page_1&&
> +	test_diff_directories mw_dir_1 ref_page_1
> +'
> +
> +
> +test_expect_success 'Git pull works with a wiki with accents in the pages names' '
> +	wiki_reset&&
> +	wiki_editpage kîî "this page must be cloned" false&&
> +	wiki_editpage foo "this page must be cloned" false&&
> +	git clone mediawiki::http://'"$SERVER_ADDR:$PORT/$WIKI_DIR_NAME"' mw_dir_2&&
> +	wiki_editpage éàîôû "This page must be pulled" false&&
> +	(cd mw_dir_2&&
> +	git pull )&&
> +	wiki_getallpage ref_page_2&&
> +	test_diff_directories mw_dir_2 ref_page_2
> +'
> +
> +# 3
> +test_expect_success 'Cloning a chosen page works with accents' '
> +	wiki_reset&&
> +	wiki_editpage kîî "this page must be cloned" false&&
> +	git clone -c remote.origin.pages=kîî mediawiki::http://'"$SERVER_ADDR:$PORT/$WIKI_DIR_NAME"' mw_dir_3&&
> +	wiki_check_content mw_dir_3/Kîî.mw Kîî&&
> +	test -e mw_dir_3/Kîî.mw&&
> +	rm -rf mw_dir_3
> +'
> +
> +
> +test_expect_success 'The shallow option works with accents' '
> +	wiki_reset&&
> +	wiki_editpage néoà "1st revision, should not be cloned" false&&
> +	wiki_editpage néoà "2nd revision, should be cloned" false&&
> +	git -c remote.origin.shallow=true clone mediawiki::http://'"$SERVER_ADDR:$PORT/$WIKI_DIR_NAME"' mw_dir_4&&
> +	test_contains_N_files mw_dir_4 2&&
> +	test -e mw_dir_4/Néoà.mw&&
> +	test -e mw_dir_4/Main_Page.mw&&
> +	(cd mw_dir_4&&
> +	test `git log --oneline Néoà.mw | wc -l` -eq 1&&
> +	test `git log --oneline Main_Page.mw | wc -l ` -eq 1 )&&
> +	wiki_check_content mw_dir_4/Néoà.mw Néoà&&
> +	wiki_check_content mw_dir_4/Main_Page.mw Main_Page
> +'
> +
> +
> +test_expect_success 'Cloning works when page name first letter has an accent' '
> +	wiki_reset&&
> +	wiki_editpage îî "this page must be cloned" false&&
> +	git clone -c remote.origin.pages=îî mediawiki::http://'"$SERVER_ADDR:$PORT/$WIKI_DIR_NAME"' mw_dir_5&&
> +	test -e mw_dir_5/Îî.mw&&
> +	wiki_check_content mw_dir_5/Îî.mw Îî
> +'
> +
> +
> +test_expect_success 'Git push works with a wiki with accents' '
> +	wiki_reset&&
> +	wiki_editpage féé "lots of accents : éèàÖ" false&&
> +	wiki_editpage foo "this page must be cloned" false&&
> +	git clone mediawiki::http://'"$SERVER_ADDR:$PORT/$WIKI_DIR_NAME"' mw_dir_6&&
> +	(cd mw_dir_6&&
> +	echo "A wild Pîkächû appears on the wiki">  Pîkächû.mw&&
> +	git add Pîkächû.mw&&
> +	git commit -m "A new page appears"&&
> +	git push )&&
> +	wiki_getallpage ref_page_6&&
> +	test_diff_directories mw_dir_6 ref_page_6
> +'
> +
> +test_expect_success 'Git clone works with accentsand spaces' '
> +	wiki_reset&&
> +	wiki_editpage "é à î" "this page must be délété before the clone" false&&
> +	git clone mediawiki::http://'"$SERVER_ADDR:$PORT/$WIKI_DIR_NAME"' mw_dir_7&&
> +	wiki_getallpage ref_page_7&&
> +	test_diff_directories mw_dir_7 ref_page_7
> +'
> +
> +test_expect_success 'character $ in page name (mw ->  git)' '
> +	wiki_reset&&
> +	wiki_editpage file_\$_foo "expect to be called file_$_foo" false&&
> +	git clone mediawiki::http://'"$SERVER_ADDR:$PORT/$WIKI_DIR_NAME"' mw_dir_8&&
> +	test -f mw_dir_8/File_\$_foo.mw&&
> +	wiki_getallpage ref_page_8&&
> +	test_diff_directories mw_dir_8 ref_page_8
> +'
> +
> +
> +
> +test_expect_success 'character $ in file name (git ->  mw) ' '
> +	wiki_reset&&
> +	git clone mediawiki::http://'"$SERVER_ADDR:$PORT/$WIKI_DIR_NAME"' mw_dir_9&&
> +	(cd mw_dir_9&&
> +	echo "this file is called File_\$_foo.mw">  File_\$_foo.mw&&
> +	git add .&&
> +	git commit -am "file File_\$_foo.mw"&&
> +	git pull&&
> +	git push )&&
> +	wiki_getallpage ref_page_9&&
> +	test_diff_directories mw_dir_9 ref_page_9
> +'
> +
> +
> +test_expect_failure 'capital at the begining of file names' '
> +	wiki_reset&&
> +	git clone mediawiki::http://'"$SERVER_ADDR:$PORT/$WIKI_DIR_NAME"' mw_dir_10&&
> +	(cd mw_dir_10&&
> +	echo "my new file foo">  foo.mw&&
> +	echo "my new file Foo... Finger crossed">  Foo.mw&&
> +	git add .&&
> +	git commit -am "file foo.mw"&&
> +	git pull&&
> +	git push )&&
> +	wiki_getallpage ref_page_10&&
> +	test_diff_directories mw_dir_10 ref_page_10
> +'
> +
> +
> +test_expect_failure 'special character at the begining of file name from mw to git' '
> +	wiki_reset&&
> +	git clone mediawiki::http://'"$SERVER_ADDR:$PORT/$WIKI_DIR_NAME"' mw_dir_11&&
> +	wiki_editpage {char_1 "expect to be renamed {char_1" false&&
> +	wiki_editpage [char_2 "expect to be renamed [char_2" false&&
> +	(cd mw_dir_11&&
> +	git pull )&&
> +	test -f mw_dir_11/{char_1&&
> +	test -f mw_dir_11/[char_2
> +'
> +
> +
> +test_expect_success 'test of correct formating for file name from mw to git' '
> +	wiki_reset&&
> +	git clone mediawiki::http://'"$SERVER_ADDR:$PORT/$WIKI_DIR_NAME"' mw_dir_12&&
> +	wiki_editpage char{_1 "expect to be renamed char{_1" false&&
> +	wiki_editpage char[_2 "expect to be renamed char{_2" false&&
> +	(cd mw_dir_12&&
> +	git pull )&&
> +	test -f mw_dir_12/Char\{_1.mw&&
> +	test -f mw_dir_12/Char\[_2.mw&&
> +	wiki_getallpage ref_page_12&&
> +	test_diff_directories mw_dir_12 ref_page_12
> +'
> +
> +
> +test_expect_failure 'test of correct formating for file name begining with special character' '
> +	wiki_reset&&
> +	git clone mediawiki::http://'"$SERVER_ADDR:$PORT/$WIKI_DIR_NAME"' mw_dir_13&&
> +	(cd mw_dir_13&&
> +	echo "my new file {char_1">  \{char_1.mw&&
> +	echo "my new file [char_2">  \[char_2.mw&&
> +	git add .&&
> +	git commit -am "commiting some exotic file name..."&&
> +	git push&&
> +	git pull)&&
> +	wiki_getallpage ref_page_13&&
> +	test -f ref_page_13/{char_1.mw&&
> +	test -f ref_page_13/[char_2.mw&&
> +	test_diff_directories mw_dir_13 ref_page_13
> +'
> +
> +
> +test_expect_success 'test of correct formating for file name from git to mw' '
> +	wiki_reset&&
> +	git clone mediawiki::http://'"$SERVER_ADDR:$PORT/$WIKI_DIR_NAME"' mw_dir_14&&
> +	(cd mw_dir_14&&
> +	echo "my new file char{_1">  Char\{_1.mw&&
> +	echo "my new file char[_2">  Char\[_2.mw&&
> +	git add .&&
> +	git commit -m "commiting some exotic file name..."&&
> +	git push )&&
> +	wiki_getallpage ref_page_14&&
> +	test_diff_directories mw_dir_14 ref_page_14
> +'
> +
> +
> +test_expect_success 'git clone with /' '
> +	wiki_reset&&
> +	wiki_editpage \/fo\/o "this is not important" false -c=Deleted&&
> +	git clone mediawiki::http://'"$SERVER_ADDR:$PORT/$WIKI_DIR_NAME"' mw_dir_15&&
> +	test -f mw_dir_15/%2Ffo%2Fo.mw&&
> +	wiki_check_content mw_dir_15/%2Ffo%2Fo.mw \/fo\/o
> +'
> +
> +
> +test_expect_success 'git push with /' '
> +	wiki_reset&&
> +	git clone mediawiki::http://'"$SERVER_ADDR:$PORT/$WIKI_DIR_NAME"' mw_dir_16&&
> +	echo "I will be on the wiki">  mw_dir_16/%2Ffo%2Fo.mw&&
> +	(cd mw_dir_16&&
> +	git add %2Ffo%2Fo.mw&&
> +	git commit -m " %2Ffo%2Fo added"&&
> +	git push)&&
> +	wiki_page_exist \/fo\/o&&
> +	wiki_check_content mw_dir_16/%2Ffo%2Fo.mw \/fo\/o
> +
> +'
> +
> +
> +test_expect_success 'git clone with \' '
> +	wiki_reset&&
> +	wiki_editpage \\ko\\o "this is not important" false -c=Deleted&&
> +	git clone mediawiki::http://'"$SERVER_ADDR:$PORT/$WIKI_DIR_NAME"' mw_dir_17&&
> +	test -f mw_dir_17/\\ko\\o.mw&&
> +	wiki_check_content mw_dir_17/\\ko\\o.mw \\ko\\o
> +'
> +
> +
> +test_expect_success 'git push with \' '
> +	wiki_reset&&
> +	git clone mediawiki::http://'"$SERVER_ADDR:$PORT/$WIKI_DIR_NAME"' mw_dir_18&&
> +	echo "I will be on the wiki">  mw_dir_18/\\ko\\o.mw&&
> +	(cd mw_dir_18&&
> +	git add \\ko\\o.mw&&
> +	git commit -m " \\ko\\o added"&&
> +	git push )&&
> +	wiki_page_exist \\ko\\o&&
> +	wiki_check_content mw_dir_18/\\ko\\o.mw \\ko\\o
> +
> +'
> +
> +test_expect_success 'git clone with \ in format control' '
> +	wiki_reset&&
> +	wiki_editpage \\no\\o "this is not important" false&&
> +	git clone mediawiki::http://'"$SERVER_ADDR:$PORT/$WIKI_DIR_NAME"' mw_dir_19&&
> +	test -f mw_dir_19/\\no\\o.mw&&
> +	wiki_check_content mw_dir_19/\\no\\o.mw \\no\\o
> +'
> +
> +
> +test_expect_success 'git push with \ in format control' '
> +	wiki_reset&&
> +	git clone mediawiki::http://'"$SERVER_ADDR:$PORT/$WIKI_DIR_NAME"' mw_dir_20&&
> +	echo "I will be on the wiki">  mw_dir_20/\\fo\\o.mw&&
> +	(cd mw_dir_20&&
> +	git add \\fo\\o.mw&&
> +	git commit -m " \\fo\\o added"&&
> +	git push )&&
> +	wiki_page_exist \\fo\\o&&
> +	wiki_check_content mw_dir_20/\\fo\\o.mw \\fo\\o
> +
> +'
> +
> +
> +test_done

-- 
CATHEBRAS Simon

2A-ENSIMAG

Filière Ingéniérie des Systèmes d'Information
Membre Bug-Buster

  reply	other threads:[~2012-06-12 21:19 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-11 20:27 [PATCH]Test environment for git-remote-mediawiki Simon.Cathebras
2012-06-11 20:28 ` [PATCHv3 1/6] Scripts to install, delete and clear a MediaWiki Simon Cathebras
2012-06-11 20:28   ` [PATCHv3 2/6] Test environment of git-remote-mediawiki Simon Cathebras
2012-06-11 20:28   ` [PATCHv3 3/6] Test file for git-remote-mediawiki clone Simon Cathebras
2012-06-11 21:07     ` konglu
2012-06-12 13:58       ` Simon.Cathebras
2012-06-11 20:28   ` [PATCHv3 4/6] Tests for git-remote-mediawiki pull Simon Cathebras
2012-06-11 21:09     ` konglu
2012-06-12 13:58       ` Simon Perrat
2012-06-12 21:12       ` [PATCH 1/6] Scripts to install, delete and clear a MediaWiki Simon Cathebras
2012-06-12 21:12         ` [PATCH 2/6] Test environment of git-remote-mediawiki Simon Cathebras
2012-06-13  7:56           ` Matthieu Moy
2012-06-13  8:10             ` Simon.Cathebras
2012-06-13 10:14           ` Ævar Arnfjörð Bjarmason
2012-06-13 17:00             ` Simon.Cathebras
2012-06-13 17:03               ` [PATCHv5 1/5] Scripts to install, delete and clear a MediaWiki Simon Cathebras
2012-06-13 17:03                 ` [PATCHv5 2/5] Test environment of git-remote-mediawiki Simon Cathebras
2012-06-13 17:03                 ` [PATCHv5 3/5] Test file for git-remote-mediawiki clone Simon Cathebras
2012-06-13 17:03                 ` [PATCHv5 4/5] Tests for git-remote-mediawiki pull and push Simon Cathebras
2012-06-13 17:03                 ` [PATCHv5 5/5] Tests of UTF8 character with git-remote-mediawiki Simon Cathebras
2012-06-14  8:57                 ` [PATCHv5 1/5] Scripts to install, delete and clear a MediaWiki Matthieu Moy
2012-06-14  8:57                   ` [PATCH 1/3] chmod -x test-gitmw-lib.sh Matthieu Moy
2012-06-14  8:57                   ` [PATCH 2/3] Coding style Matthieu Moy
2012-06-14  8:57                   ` [PATCH 3/3] Explicit error when curl_exec() fails Matthieu Moy
2012-06-14  9:23                     ` Simon.Cathebras
2012-06-14 12:45                       ` Matthieu Moy
2012-06-14  9:20                   ` [PATCHv5 1/5] Scripts to install, delete and clear a MediaWiki Simon.Cathebras
2012-06-14 16:17                     ` Matthieu Moy
2012-06-14  8:58                 ` Matthieu Moy
2012-06-12 21:12         ` [PATCH 3/6] Test file for git-remote-mediawiki clone Simon Cathebras
2012-06-12 21:34           ` konglu
2012-06-13  7:20             ` Simon.Cathebras
2012-06-12 21:12         ` [PATCH 4/6] Tests for git-remote-mediawiki pull and push Simon Cathebras
2012-06-12 21:12         ` [PATCH 5/6] Tests of UTF8 character with git-remote-mediawiki Simon Cathebras
2012-06-12 21:18           ` Simon.Cathebras [this message]
2012-06-12 21:52             ` konglu
2012-06-13  7:30               ` Simon.Cathebras
2012-06-12 21:45           ` konglu
2012-06-11 20:28   ` [PATCHv3 5/6] Test file for git-remote-mediawiki push Simon Cathebras
2012-06-11 20:28   ` =?y?q?=5BPATCHv3=206/6=5D=20Tests=20of=20UTF8=20character=20with=20git-remote-mediawiki?= Simon Cathebras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FD7B242.9020005@ensimag.imag.fr \
    --to=simon.cathebras@ensimag.imag.fr \
    --cc=charles.roussel@ensimag.imag.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=guillaume.sasdy@ensimag.imag.fr \
    --cc=julien.khayat@ensimag.imag.fr \
    --cc=matthieu.moy@imag.fr \
    --cc=peff@peff.net \
    --cc=simon.perrat@ensimag.imag.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.