1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

v2.11.2.1

This commit is contained in:
gnosygnu
2015-11-08 23:48:07 -05:00
parent b990ec409f
commit d9f45cec19
298 changed files with 3908 additions and 2141 deletions

View File

@@ -60,7 +60,7 @@ public class Xowc_xtn_pages implements GfoInvkAble {
private int Set_canonical(Xow_ns_mgr ns_mgr, int aliases_added, int id, byte[] name) {
Xow_ns ns = ns_mgr.Ids_get_or_null(id);
if ( ns == null // ns doesn't exist; should throw error;
|| !Bry_.Eq(ns.Name_bry(), name) // ns exists, but name doesn't match canonical
|| !Bry_.Eq(ns.Name_db(), name) // ns exists, but name doesn't match canonical
) {
ns_mgr.Aliases_add(id, String_.new_a7(name));
++aliases_added;

View File

@@ -67,13 +67,13 @@ public class Xoa_url_parser__xwiki_tst {
@Test public void Xwiki__to_enwiki() { // PURPOSE: handle alias of "wikipedia" and sv.wikipedia.org/wiki/Wikipedia:Main_Page; DATE:2015-07-31
Xowe_wiki xwiki = tstr.Prep_create_wiki("sv.wikipedia.org");
tstr.Prep_xwiki(xwiki, "wikipedia", "en.wikipedia.org", null);
tstr.Prep_get_ns_mgr_from_meta("sv.wikipedia.org").Add_new(Xow_ns_.Id_project, "Wikipedia");
tstr.Prep_get_ns_mgr_from_meta("sv.wikipedia.org").Add_new(Xow_ns_.Tid__project, "Wikipedia");
tstr.Run_parse(xwiki, "sv.wikipedia.org/wiki/wikipedia:X").Chk_wiki("sv.wikipedia.org").Chk_page("wikipedia:X");
tstr.Run_parse(xwiki, "sv.wikipedia.org/wiki/Wikipedia:X").Chk_wiki("sv.wikipedia.org").Chk_page("Wikipedia:X");
}
@Test public void Xwiki__to_ns() { // PURPOSE: handle alias of "wikipedia" in current, but no "Wikipedia" ns in other wiki; PAGE:pt.w:Wikipedia:P<>gina_de_testes DATE:2015-09-17
tstr.Prep_create_wiki("pt.wikipedia.org");
tstr.Prep_get_ns_mgr_from_meta("pt.wikipedia.org").Add_new(Xow_ns_.Id_project, "Project"); // clear ns_mgr and add only "Project" ns, not "Wikipedia" ns
tstr.Prep_get_ns_mgr_from_meta("pt.wikipedia.org").Add_new(Xow_ns_.Tid__project, "Project"); // clear ns_mgr and add only "Project" ns, not "Wikipedia" ns
tstr.Prep_xwiki(tstr.Wiki(), "wikipedia", "en.wikipedia.org", null); // add alias of "wikipedia" in current wiki
tstr.Run_parse(tstr.Wiki(), "pt.wikipedia.org/wiki/Wikipedia:X").Chk_wiki("pt.wikipedia.org").Chk_page("Wikipedia:X"); // should get "pt.wikipedia.org", not "en.wikipedia.org" (through alias)
}