(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"Test git-mediawiki with special characters in filenames">)} spids: [35] ) ] spids: [35] ) (C {(.)} {(./test-gitmw-lib.sh)}) (C {(.)} {($ VSub_Name "$TEST_DIRECTORY") (/test-lib.sh)}) (C {(test_check_precond)}) (C {(test_expect_success)} {(SQ <"Git clone works for a wiki with accents in the page names">)} { (SQ <"\n"> <"\twiki_reset &&\n"> < "\twiki_editpage f\u00e9\u00e9 \"This page must be d\u00e9l\u00e9t\u00e9d before clone\" false &&\n" > <"\twiki_editpage k\u00e8\u00e8 \"This page must be deleted before clone\" false &&\n"> <"\twiki_editpage h\u00e0\u00e0 \"This page must be deleted before clone\" false &&\n"> <"\twiki_editpage k\u00ee\u00ee \"This page must be deleted before clone\" false &&\n"> <"\twiki_editpage foo \"This page must be deleted before clone\" false &&\n"> <"\tgit clone mediawiki::"> ) (DQ ($ VSub_Name "$WIKI_URL")) (SQ <" mw_dir_1 &&\n"> <"\twiki_getallpage ref_page_1 &&\n"> <"\ttest_diff_directories mw_dir_1 ref_page_1\n"> ) } ) (C {(test_expect_success)} {(SQ <"Git pull works with a wiki with accents in the pages names">)} { (SQ <"\n"> <"\twiki_reset &&\n"> <"\twiki_editpage k\u00ee\u00ee \"this page must be cloned\" false &&\n"> <"\twiki_editpage foo \"this page must be cloned\" false &&\n"> <"\tgit clone mediawiki::"> ) (DQ ($ VSub_Name "$WIKI_URL")) (SQ <" mw_dir_2 &&\n"> < "\twiki_editpage \u00e9\u00e0\u00ee\u00f4\u00fb \"This page must be pulled\" false &&\n" > <"\t(\n"> <"\t\tcd mw_dir_2 &&\n"> <"\t\tgit pull\n"> <"\t) &&\n"> <"\twiki_getallpage ref_page_2 &&\n"> <"\ttest_diff_directories mw_dir_2 ref_page_2\n"> ) } ) (C {(test_expect_success)} {(SQ <"Cloning a chosen page works with accents">)} { (SQ <"\n"> <"\twiki_reset &&\n"> <"\twiki_editpage k\u00ee\u00ee \"this page must be cloned\" false &&\n"> <"\tgit clone -c remote.origin.pages=k\u00ee\u00ee \\\n"> <"\t\tmediawiki::"> ) (DQ ($ VSub_Name "$WIKI_URL")) (SQ <" mw_dir_3 &&\n"> <"\twiki_check_content mw_dir_3/K\u00ee\u00ee.mw K\u00ee\u00ee &&\n"> <"\ttest_path_is_file mw_dir_3/K\u00ee\u00ee.mw &&\n"> <"\trm -rf mw_dir_3\n"> ) } ) (C {(test_expect_success)} {(SQ <"The shallow option works with accents">)} { (SQ <"\n"> <"\twiki_reset &&\n"> <"\twiki_editpage n\u00e9o\u00e0 \"1st revision, should not be cloned\" false &&\n"> <"\twiki_editpage n\u00e9o\u00e0 \"2nd revision, should be cloned\" false &&\n"> <"\tgit -c remote.origin.shallow=true clone \\\n"> <"\t\tmediawiki::"> ) (DQ ($ VSub_Name "$WIKI_URL")) (SQ <" mw_dir_4 &&\n"> <"\ttest_contains_N_files mw_dir_4 2 &&\n"> <"\ttest_path_is_file mw_dir_4/N\u00e9o\u00e0.mw &&\n"> <"\ttest_path_is_file mw_dir_4/Main_Page.mw &&\n"> <"\t(\n"> <"\t\tcd mw_dir_4 &&\n"> <"\t\ttest $(git log --oneline N\u00e9o\u00e0.mw | wc -l) -eq 1 &&\n"> <"\t\ttest $(git log --oneline Main_Page.mw | wc -l ) -eq 1\n"> <"\t) &&\n"> <"\twiki_check_content mw_dir_4/N\u00e9o\u00e0.mw N\u00e9o\u00e0 &&\n"> <"\twiki_check_content mw_dir_4/Main_Page.mw Main_Page\n"> ) } ) (C {(test_expect_success)} {(SQ <"Cloning works when page name first letter has an accent">)} { (SQ <"\n"> <"\twiki_reset &&\n"> <"\twiki_editpage \u00ee\u00ee \"this page must be cloned\" false &&\n"> <"\tgit clone -c remote.origin.pages=\u00ee\u00ee \\\n"> <"\t\tmediawiki::"> ) (DQ ($ VSub_Name "$WIKI_URL")) (SQ <" mw_dir_5 &&\n"> <"\ttest_path_is_file mw_dir_5/\u00ce\u00ee.mw &&\n"> <"\twiki_check_content mw_dir_5/\u00ce\u00ee.mw \u00ce\u00ee\n"> ) } ) (C {(test_expect_success)} {(SQ <"Git push works with a wiki with accents">)} { (SQ <"\n"> <"\twiki_reset &&\n"> < "\twiki_editpage f\u00e9\u00e9 \"lots of accents : \u00e9\u00e8\u00e0\u00d6\" false &&\n" > <"\twiki_editpage foo \"this page must be cloned\" false &&\n"> <"\tgit clone mediawiki::"> ) (DQ ($ VSub_Name "$WIKI_URL")) (SQ <" mw_dir_6 &&\n"> <"\t(\n"> <"\t\tcd mw_dir_6 &&\n"> < "\t\techo \"A wild P\u00eek\u00e4ch\u00fb appears on the wiki\" >P\u00eek\u00e4ch\u00fb.mw &&\n" > <"\t\tgit add P\u00eek\u00e4ch\u00fb.mw &&\n"> <"\t\tgit commit -m \"A new page appears\" &&\n"> <"\t\tgit push\n"> <"\t) &&\n"> <"\twiki_getallpage ref_page_6 &&\n"> <"\ttest_diff_directories mw_dir_6 ref_page_6\n"> ) } ) (C {(test_expect_success)} {(SQ <"Git clone works with accentsand spaces">)} { (SQ <"\n"> <"\twiki_reset &&\n"> < "\twiki_editpage \"\u00e9 \u00e0 \u00ee\" \"this page must be d\u00e9l\u00e9t\u00e9 before the clone\" false &&\n" > <"\tgit clone mediawiki::"> ) (DQ ($ VSub_Name "$WIKI_URL")) (SQ <" mw_dir_7 &&\n"> <"\twiki_getallpage ref_page_7 &&\n"> <"\ttest_diff_directories mw_dir_7 ref_page_7\n"> ) } ) (C {(test_expect_success)} {(SQ <"character $ in page name (mw -> git)">)} { (SQ <"\n"> <"\twiki_reset &&\n"> <"\twiki_editpage file_\\$_foo \"expect to be called file_$_foo\" false &&\n"> <"\tgit clone mediawiki::"> ) (DQ ($ VSub_Name "$WIKI_URL")) (SQ <" mw_dir_8 &&\n"> <"\ttest_path_is_file mw_dir_8/File_\\$_foo.mw &&\n"> <"\twiki_getallpage ref_page_8 &&\n"> <"\ttest_diff_directories mw_dir_8 ref_page_8\n"> ) } ) (C {(test_expect_success)} {(SQ <"character $ in file name (git -> mw) ">)} {(SQ <"\n"> <"\twiki_reset &&\n"> <"\tgit clone mediawiki::">) (DQ ($ VSub_Name "$WIKI_URL")) (SQ <" mw_dir_9 &&\n"> <"\t(\n"> <"\t\tcd mw_dir_9 &&\n"> <"\t\techo \"this file is called File_\\$_foo.mw\" >File_\\$_foo.mw &&\n"> <"\t\tgit add . &&\n"> <"\t\tgit commit -am \"file File_\\$_foo.mw\" &&\n"> <"\t\tgit pull &&\n"> <"\t\tgit push\n"> <"\t) &&\n"> <"\twiki_getallpage ref_page_9 &&\n"> <"\ttest_diff_directories mw_dir_9 ref_page_9\n"> ) } ) (C {(test_expect_failure)} {(SQ <"capital at the beginning of file names">)} {(SQ <"\n"> <"\twiki_reset &&\n"> <"\tgit clone mediawiki::">) (DQ ($ VSub_Name "$WIKI_URL")) (SQ <" mw_dir_10 &&\n"> <"\t(\n"> <"\t\tcd mw_dir_10 &&\n"> <"\t\techo \"my new file foo\" >foo.mw &&\n"> <"\t\techo \"my new file Foo... Finger crossed\" >Foo.mw &&\n"> <"\t\tgit add . &&\n"> <"\t\tgit commit -am \"file foo.mw\" &&\n"> <"\t\tgit pull &&\n"> <"\t\tgit push\n"> <"\t) &&\n"> <"\twiki_getallpage ref_page_10 &&\n"> <"\ttest_diff_directories mw_dir_10 ref_page_10\n"> ) } ) (C {(test_expect_failure)} {(SQ <"special character at the beginning of file name from mw to git">)} {(SQ <"\n"> <"\twiki_reset &&\n"> <"\tgit clone mediawiki::">) (DQ ($ VSub_Name "$WIKI_URL")) (SQ <" mw_dir_11 &&\n"> <"\twiki_editpage {char_1 \"expect to be renamed {char_1\" false &&\n"> <"\twiki_editpage [char_2 \"expect to be renamed [char_2\" false &&\n"> <"\t(\n"> <"\t\tcd mw_dir_11 &&\n"> <"\t\tgit pull\n"> <"\t) &&\n"> <"\ttest_path_is_file mw_dir_11/{char_1 &&\n"> <"\ttest_path_is_file mw_dir_11/[char_2\n"> ) } ) (C {(test_expect_success)} {(SQ <"Pull page with title containing \":\" other than namespace separator">)} { (SQ <"\n"> <"\twiki_editpage Foo:Bar content false &&\n"> <"\t(\n"> <"\t\tcd mw_dir_11 &&\n"> <"\t\tgit pull\n"> <"\t) &&\n"> <"\ttest_path_is_file mw_dir_11/Foo:Bar.mw\n"> ) } ) (C {(test_expect_success)} {(SQ <"Push page with title containing \":\" other than namespace separator">)} { (SQ <"\n"> <"\t(\n"> <"\t\tcd mw_dir_11 &&\n"> <"\t\techo content >NotANameSpace:Page.mw &&\n"> <"\t\tgit add NotANameSpace:Page.mw &&\n"> <"\t\tgit commit -m \"add page with colon\" &&\n"> <"\t\tgit push\n"> <"\t) &&\n"> <"\twiki_page_exist NotANameSpace:Page\n"> ) } ) (C {(test_expect_success)} {(SQ <"test of correct formatting for file name from mw to git">)} {(SQ <"\n"> <"\twiki_reset &&\n"> <"\tgit clone mediawiki::">) (DQ ($ VSub_Name "$WIKI_URL")) (SQ <" mw_dir_12 &&\n"> <"\twiki_editpage char_%_7b_1 \"expect to be renamed char{_1\" false &&\n"> <"\twiki_editpage char_%_5b_2 \"expect to be renamed char{_2\" false &&\n"> <"\t(\n"> <"\t\tcd mw_dir_12 &&\n"> <"\t\tgit pull\n"> <"\t) &&\n"> <"\ttest_path_is_file mw_dir_12/Char\\{_1.mw &&\n"> <"\ttest_path_is_file mw_dir_12/Char\\[_2.mw &&\n"> <"\twiki_getallpage ref_page_12 &&\n"> <"\tmv ref_page_12/Char_%_7b_1.mw ref_page_12/Char\\{_1.mw &&\n"> <"\tmv ref_page_12/Char_%_5b_2.mw ref_page_12/Char\\[_2.mw &&\n"> <"\ttest_diff_directories mw_dir_12 ref_page_12\n"> ) } ) (C {(test_expect_failure)} {(SQ <"test of correct formatting for file name beginning with special character">)} {(SQ <"\n"> <"\twiki_reset &&\n"> <"\tgit clone mediawiki::">) (DQ ($ VSub_Name "$WIKI_URL")) (SQ <" mw_dir_13 &&\n"> <"\t(\n"> <"\t\tcd mw_dir_13 &&\n"> <"\t\techo \"my new file {char_1\" >\\{char_1.mw &&\n"> <"\t\techo \"my new file [char_2\" >\\[char_2.mw &&\n"> <"\t\tgit add . &&\n"> <"\t\tgit commit -am \"committing some exotic file name...\" &&\n"> <"\t\tgit push &&\n"> <"\t\tgit pull\n"> <"\t) &&\n"> <"\twiki_getallpage ref_page_13 &&\n"> <"\ttest_path_is_file ref_page_13/{char_1.mw &&\n"> <"\ttest_path_is_file ref_page_13/[char_2.mw &&\n"> <"\ttest_diff_directories mw_dir_13 ref_page_13\n"> ) } ) (C {(test_expect_success)} {(SQ <"test of correct formatting for file name from git to mw">)} {(SQ <"\n"> <"\twiki_reset &&\n"> <"\tgit clone mediawiki::">) (DQ ($ VSub_Name "$WIKI_URL")) (SQ <" mw_dir_14 &&\n"> <"\t(\n"> <"\t\tcd mw_dir_14 &&\n"> <"\t\techo \"my new file char{_1\" >Char\\{_1.mw &&\n"> <"\t\techo \"my new file char[_2\" >Char\\[_2.mw &&\n"> <"\t\tgit add . &&\n"> <"\t\tgit commit -m \"committing some exotic file name...\" &&\n"> <"\t\tgit push\n"> <"\t) &&\n"> <"\twiki_getallpage ref_page_14 &&\n"> <"\tmv mw_dir_14/Char\\{_1.mw mw_dir_14/Char_%_7b_1.mw &&\n"> <"\tmv mw_dir_14/Char\\[_2.mw mw_dir_14/Char_%_5b_2.mw &&\n"> <"\ttest_diff_directories mw_dir_14 ref_page_14\n"> ) } ) (C {(test_expect_success)} {(SQ <"git clone with /">)} { (SQ <"\n"> <"\twiki_reset &&\n"> <"\twiki_editpage \\/fo\\/o \"this is not important\" false -c=Deleted &&\n"> <"\tgit clone mediawiki::"> ) (DQ ($ VSub_Name "$WIKI_URL")) (SQ <" mw_dir_15 &&\n"> <"\ttest_path_is_file mw_dir_15/%2Ffo%2Fo.mw &&\n"> <"\twiki_check_content mw_dir_15/%2Ffo%2Fo.mw \\/fo\\/o\n"> ) } ) (C {(test_expect_success)} {(SQ <"git push with /">)} {(SQ <"\n"> <"\twiki_reset &&\n"> <"\tgit clone mediawiki::">) (DQ ($ VSub_Name "$WIKI_URL")) (SQ <" mw_dir_16 &&\n"> <"\techo \"I will be on the wiki\" >mw_dir_16/%2Ffo%2Fo.mw &&\n"> <"\t(\n"> <"\t\tcd mw_dir_16 &&\n"> <"\t\tgit add %2Ffo%2Fo.mw &&\n"> <"\t\tgit commit -m \" %2Ffo%2Fo added\" &&\n"> <"\t\tgit push\n"> <"\t) &&\n"> <"\twiki_page_exist \\/fo\\/o &&\n"> <"\twiki_check_content mw_dir_16/%2Ffo%2Fo.mw \\/fo\\/o\n"> <"\n"> ) } ) (C {(test_expect_success)} {(SQ <"git clone with \\">)} { (SQ <"\n"> <"\twiki_reset &&\n"> <"\twiki_editpage \\\\ko\\\\o \"this is not important\" false -c=Deleted &&\n"> <"\tgit clone mediawiki::"> ) (DQ ($ VSub_Name "$WIKI_URL")) (SQ <" mw_dir_17 &&\n"> <"\ttest_path_is_file mw_dir_17/\\\\ko\\\\o.mw &&\n"> <"\twiki_check_content mw_dir_17/\\\\ko\\\\o.mw \\\\ko\\\\o\n"> ) } ) (C {(test_expect_success)} {(SQ <"git push with \\">)} {(SQ <"\n"> <"\twiki_reset &&\n"> <"\tgit clone mediawiki::">) (DQ ($ VSub_Name "$WIKI_URL")) (SQ <" mw_dir_18 &&\n"> <"\techo \"I will be on the wiki\" >mw_dir_18/\\\\ko\\\\o.mw &&\n"> <"\t(\n"> <"\t\tcd mw_dir_18 &&\n"> <"\t\tgit add \\\\ko\\\\o.mw &&\n"> <"\t\tgit commit -m \" \\\\ko\\\\o added\" &&\n"> <"\t\tgit push\n"> <"\t)&&\n"> <"\twiki_page_exist \\\\ko\\\\o &&\n"> <"\twiki_check_content mw_dir_18/\\\\ko\\\\o.mw \\\\ko\\\\o\n"> <"\n"> ) } ) (C {(test_expect_success)} {(SQ <"git clone with \\ in format control">)} { (SQ <"\n"> <"\twiki_reset &&\n"> <"\twiki_editpage \\\\no\\\\o \"this is not important\" false &&\n"> <"\tgit clone mediawiki::"> ) (DQ ($ VSub_Name "$WIKI_URL")) (SQ <" mw_dir_19 &&\n"> <"\ttest_path_is_file mw_dir_19/\\\\no\\\\o.mw &&\n"> <"\twiki_check_content mw_dir_19/\\\\no\\\\o.mw \\\\no\\\\o\n"> ) } ) (C {(test_expect_success)} {(SQ <"git push with \\ in format control">)} {(SQ <"\n"> <"\twiki_reset &&\n"> <"\tgit clone mediawiki::">) (DQ ($ VSub_Name "$WIKI_URL")) (SQ <" mw_dir_20 &&\n"> <"\techo \"I will be on the wiki\" >mw_dir_20/\\\\fo\\\\o.mw &&\n"> <"\t(\n"> <"\t\tcd mw_dir_20 &&\n"> <"\t\tgit add \\\\fo\\\\o.mw &&\n"> <"\t\tgit commit -m \" \\\\fo\\\\o added\" &&\n"> <"\t\tgit push\n"> <"\t)&&\n"> <"\twiki_page_exist \\\\fo\\\\o &&\n"> <"\twiki_check_content mw_dir_20/\\\\fo\\\\o.mw \\\\fo\\\\o\n"> <"\n"> ) } ) (C {(test_expect_success)} {(SQ <"fast-import meta-characters in page name (mw -> git)">)} { (SQ <"\n"> <"\twiki_reset &&\n"> < "\twiki_editpage \\\"file\\\"_\\\\_foo \"expect to be called \\\"file\\\"_\\\\_foo\" false &&\n" > <"\tgit clone mediawiki::"> ) (DQ ($ VSub_Name "$WIKI_URL")) (SQ <" mw_dir_21 &&\n"> <"\ttest_path_is_file mw_dir_21/\\\"file\\\"_\\\\_foo.mw &&\n"> <"\twiki_getallpage ref_page_21 &&\n"> <"\ttest_diff_directories mw_dir_21 ref_page_21\n"> ) } ) (C {(test_expect_success)} {(SQ <"fast-import meta-characters in page name (git -> mw) ">)} {(SQ <"\n"> <"\twiki_reset &&\n"> <"\tgit clone mediawiki::">) (DQ ($ VSub_Name "$WIKI_URL")) (SQ <" mw_dir_22 &&\n"> <"\t(\n"> <"\t\tcd mw_dir_22 &&\n"> <"\t\techo \"this file is called \\\"file\\\"_\\\\_foo.mw\" >\\\"file\\\"_\\\\_foo &&\n"> <"\t\tgit add . &&\n"> <"\t\tgit commit -am \"file \\\"file\\\"_\\\\_foo\" &&\n"> <"\t\tgit pull &&\n"> <"\t\tgit push\n"> <"\t) &&\n"> <"\twiki_getallpage ref_page_22 &&\n"> <"\ttest_diff_directories mw_dir_22 ref_page_22\n"> ) } ) (C {(test_done)}) ] )